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'd suggest running the finalizers in the reverse order
Alastair wrote:
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.
Sorry, this was nonsense - I hadn't noticed that is was a