Nicholas Clark wrote:
On Thu, Jan 02, 2003 at 08:12:45PM +0100, Leopold Toetsch wrote:
[ refcounting ]
Effectively everything currently holding an object needing active destruction becomes an object needing active destruction, (for the duration, but no longer), and so on all the way back up to the root set. Whether in practical terms this turns out to mean virtually everything anyway, I don't know.
As you don't know, where such an object may be stored, you have the "virtually everything".
We're not guaranteeing perfection, though, are we? Just better than perl5?
Dan did outline our strategy, which seems to be very reasonbale for me. If timers or such have to be destroyed at the end of scope, the HL is responsible for telling parrot about this, either by an explicit "sweep" call, or - with more coding on parrots side - by some counting of "must destroy objects" + a full DOD run.
[ie things wanting timely destruction get their destructor called at the correct time, unless you've been silly enough to send them off into a refcount loop. In which case they will get spotted at some point probably before program exit, compared with perl5 which only spots them if your program exits]
Yep. A reference to an object is a reference the programmer of such code has to be aware of. And - Parrot doesn't suffer of refcount loops.
Nicholas Clark
leo