A Reference is an identifier for some other object. It is mostly used by the garbage collector (see section 9.3) to figure out which parts of the database depend on which other parts.
It is also used to prevent circular Hash references (where the contents
of a file
are generated by applying a transform to file
, but
the contents of file
are in turn generated by applying a transform
to file
, so neither
nor
can be generated at all).
A Reference consists of the following catenated together:
In cases where an object references multiple objects, the individual Reference objects as described above are catenated together. As a convenience, the object type 0 (NUL) is not allowed, and can be used as a delimiter between a list of References and other data.
All object types between 65 and 90 (ASCII `A' through `Z') are reserved for use by fakefs. Wherever possible, object types should be allocated dynamically by plugins. A registry is provided for this purpose.