[gclist] finalization

David Chase chase@world.std.com
Sun, 18 May 1997 23:36:21 -0400


At 06:38 PM 5/16/97 -0400, you wrote:
>Can anyone point me to information on implementing
>finalization.  I'm kinda looking for the gory detail, all
>I can find is overviews??

If I had time, I'd tell you in detail, but I don't.  Basic
idea, if you have optional finalization, is to keep a table
full of "hidden" pointers (either "encrypted", or simply explicitly
not scanned by the GC).  After the GC runs, the table must be
checked for each about-to-be freed cell, and those found in the
table, are placed in a queue (accessible to the garbage collector,
now) and the elements in the queue are processed by running
their finalizers.  Details, such as answers to "what order is
used to place elements in the queue?" and "what do you do if
A and B are on the finalizer queue, and running A's finalizer
makes B reachable from an ordinary root?" seem to provoke long
and fruitless (no consensus is ever reached) debate.

David Chase