addForeignPtrFinalizer

Alastair Reid alastair at reid-consulting-uk.ltd.uk
Tue Sep 24 12:37:42 EDT 2002


> The spec says there are no guarantees on the order in which the
> finalizers are run.  Doesn't this make this function almost
> impossible to use?  Suppose one finalizer frees the storage and the
> other cleans up something it refers to.

I seem to remember that Sigbjorn and Erik dealt with this problem by
arranging some kind of GC-visible link between the objects so that
until the second finalizer has run, the object will not be considered
garbage.

I can't remember the details though...  Can you remind us how it
worked, Sigbjorn?  Was it in the heaven from hell paper?

--
Alastair




More information about the FFI mailing list