destructors, how?

Lex Spoon squeak-dev at lists.squeakfoundation.org
Sat Oct 26 18:05:37 UTC 2002


John M McIntosh <johnmci at smalltalkconsulting.com> wrote:
> 
> I'll point out some smalltalk implementations ask the executor what to  
> do and give it reference to the 'dead' object as part of the  
> finalization process. The executor can then decide to 'resurrect' the  
> 'dead' object by making a reference to it again. Tho somehow my head  
> hurts when asked to justify this action and the business model that  
> would require you to do it.

I don't know a reason, either, but note that it's a lot of trouble to
*stop* people from ressurecting things!  Also, it's not hard to just
mark objects with a "finalized" flag; if an object has already been
fianlized, then you deallocate it instead of running the finalizer. 
(Assuming that you don't want to re-finalize ressurected objects at
their second death.  This seems fine -- again, this is goofy code we are
talking about!)

These problems are avoided in Squeak, because Andreas set it up to run
the executor only when the object is *really* dead.


Lex



More information about the Squeak-dev mailing list