Reference counting

agree at carltonfields.com agree at carltonfields.com
Tue Oct 26 17:45:12 UTC 1999


> On Tue, 26 Oct 1999 11:11:57 -0400 agree at carltonfields.com wrote:
> >I would appreciate an explanation of their utility.  I'm > sure I'm simply being dull, but I don't understand why this > would be necessary or helpful.
> > Think of it as a virtual-memory substitute: > recently/frequently used objects would tend to stay in memory > and would only get purged when space was running low. The > current garbage collection purges objects as soon as they are > no longer referenced, without regard to the cost of > recreating them or the possibility that they will be needed soon.

Is that right?  I was under the impression that the object isn't purged until the gc occurs. [Indeed, what is described is something more like reference counting than gc].  Further, can't you register objects for finalization, thus giving each object a chance to say "I want to stay?" or to copy itself somewhere -- or would that action be beyond the scope of a valid finalization action?

Sorry if I'm still being dull.





More information about the Squeak-dev mailing list