Subject: Re: [boost] request for discussion - yet another approach to automated memory management that solves the cycles problem and is very efficient
From: Larry Evans (cppljevans_at_[hidden])
Date: 2009-02-26 20:01:03
On 02/26/09 18:07, Achilleas Margaritis wrote:
> 3) it does not scan the graph of objects for reachability. It uses
> simple numeric values (i.e. keys) to determine if an object can be
> collected or not.
> The idea is very simple: pointers obtain keys during their construction
> (a simple global variable that is incremented). The key remains constant
> throughout the lifetime of a ptr.
> During pointer release, the pointers that point to an object are
> scanned: if there is no pointer that points to the object that has a
> lower key from the key of the releasing pointer, then the object can be
Could you explain why this should work? IOW, why does the test:
>> if there is no pointer that points to the object that has a
>> lower key from the key of the releasing pointer,
assure that it's OK to delete the object?
Also, to conduct the test, it appears each pointee has to maintain
a set of pointer's to itself, which, I think, doubles the number
of pointers, i.e. if there's and edge a -> b in the pointer graph,
there most also be an edge b -> a stored in b somewhere. Is that
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk