[gclist] Precise GC's performance

boehm.PARC@xerox.com boehm.PARC@xerox.com
Fri, 8 Mar 1996 12:19:41 PST


Darius Blasband writes:

"When the YAFL GC is started, a first mark pass is performed. Then, on all
objects which have been found not to be reachable anymore from the root sets,
the KILL method is applied if defined. No deallocation is performed yet. Hence,
no cycle problem.

Then, a brand new mark pass is performed, and all objects which have been
found unreachable on both of these passes are deallocated. This allows for
"last chance rescue": when a given object is being killed, it can rescue
itself from deallocation by setting an external reference to itself as part
of its KILL method.

I don't know whether such a scheme can be implemented on top of Boehm's
GC. Any clue ?"

I think this is the same procedure that Mark Tillotson proposed.  It has the
advantage that cycles don't inhibit finalization and that you don't get
dangling pointers.  It has the disadvantage that if A refers to B, and both
have finalization code, A may see a version of B that has already been
finalized.  As I argued before, this strikes me as less clean than dealing with
cycles (either by breaking them with a suitable primitive or by separating out
references needed during finalization).  But that may be a matter of taste.

I think there's currently no may to implement this on top of our collector
without making copies of objects.  Adding it would involve a very local and
fairly simple change to the collector code.  (Actually there may be an obscure
way to do it, but modifying the collector would be cleaner.)

Hans
Standard disclaimer ...