Root Pointer introduces the concept of set where it is
defined to be a one or many memory blocks referencing each other allocated
on the heap pointed to by one or many root_ptr<T>
s
allocated elsewhere by the application. Each set is consequently
composed of a list of all memory blocks constituting it and a node_proxy
linking each allocation and other
potential node_proxy
s.
For example:
Therefore whenever a node_proxy
contained within a root_ptr<T>
is about to be destroyed, the deallocation of each memory block composing the
set is enforced. Thus whether the set
was composed of memory blocks referencing each other in a cyclic way or not,
all of them will be subject to destruction and deallocation indifferent from
the cyclicism problem presented by the reference counters. As we can see in
the following example, the node_proxy
is destroyed and consequently every elements composing the set
will be destructed and deallocated as well:
A set will be unified with another set whenever one of its member is found to reference a member from a different set. Once two sets are unified they will stay unified even if the new reference responsible for unifying the sets is once again disjointed.