Next: Cycle Dismantling, Previous: Detecting Cycles, Up: Referable Objects [Index]
Objects tracking references to themselves maintain a list of references, a list
in which each item corresponds a tracked reference. The list items identify
the objects holding the references by the address of one of their attribute.
The latter is typed as struct x1f4_nodelink_type
.
See struct x1f4_nodelink_type.
Objects in the libaime type system (those that may hold references and
be themselves referred) embed thus a struct x1f4_nodelink_type
record.
The address at which this record is stored is offered to the referred objects
for up tracing purposes.
See Detecting Cycles.
The maintained references list is a list of pointers to struct
x1f4_nodelink_type
records.
The embedded struct x1f4_nodelink_type
record needs to be set up before
it is published.
Its slip
field is the flag space required for tracking the already
visited references when running the cycle detection algorithm and needs be
NULL
outside the cycle detection algorithm.
The other struct x1f4_nodelink_type
record field, miss
, is the
address of the routine determining whether the object (which embeds the
struct x1f4_nodelink_type
record) is variable referred. The method is
expected to return a non zero value if the object is variable referred, zero
otherwise.
When called, the routine indicated by the miss
field will be supplied
with
struct x1f4_nodelink_type
pointer to construct the
linked list of the visited references
struct x1f4_nodelink_type
pointer to construct the
linked list of the to be visited references
struct x1f4_nodelink_type
record from which the
routine address was picked up
as arguments, in this order.
What such routine would do is:
slip
field
of its last argument. If that’s the case it would return zero without further
processing (for else the the cycle detection algorithm might run endlessly).
slip
field of its last argument
with the value of the struct x1f4_nodelink_type
pointer stored at the
address indicated by its second argument (the previously visited object) and
store its last struct x1f4_nodelink_type
pointer argument (the address
by which the object is to be known) at the address indicated by its second
argument.
Next: Cycle Dismantling, Previous: Detecting Cycles, Up: Referable Objects [Index]