[gclist] must-finalize == reference count
Charles Fiterman
cef@geode.geodesic.com
Tue, 12 Mar 1996 14:36:13 -0600
Suppose we are supporting an object type which I will call
must-finalize. That means the program is buggy if finalizers
on this type of object are not called. And further those
finalizers should idealy be called quite quickly.
I say this object type is identical to a reference counted
object with the following restrictions.
1) Ordinary pointers will not keep this kind of object alive.
Ideally they should not be allowed. A pointer to a must-finalize
object is a reference count pointer or a type error.
2) No circularity is allowed. When a pointer to a must-finalize
object is set there is a circularity check. Or at some point
there is a circularity check. The newest must-finalize object
may have pointers to older must finalize objects with no
expensive check. A non must-finalize object may have pointers
to must-finalize objects with no expensive checks. This allows
long chains to be kept cheaply.
Now when a pointer to a must-finalize object is deleted or changed
it decrements a reference count which may delete a must-finalize object.
At program termination pointers to must-finalize objects from stack
and static areas are deleted.
This allows execution frames to have their own cleanup sections
and to point back to other execution frames. It allows a clean
and efficient implementation of exceptions in a language where
execution frames are allocated on the heap.