On Nov 23, 2005, at 3:06, chromatic wrote:
On Wed, 2005-11-23 at 01:39 +0100, Leopold Toetsch wrote:
But my argument was: whenever you
start introspecting a call frame, by almost whatever means, this will
keep the call frame alive[1] (see Continuation or Closure). That is:
timely destruction doesn't work for example...
Destruction or finalization?
We don't have these two separated yet, but it wouldn't matter. Both can
only happen after the GC has decided that the object is unreferenced.
That is, if I have a filehandle I really
want to close at the end of a scope but I don't care when GC drags it
into the void, will the close happen even if there's introspection
somewhere?
*If* introspection sets the life bit ("increments refcount") of the
refered item(s) then destruction/finalization can only happen, after
that introspection object is also dead.
It's the same as: when you store a filehandle into an array, the
filehandle will be bound to the life period of that array.
The problem now is that there isn't any guarantee that such an
introspection PMC stays in that call frame, the function could just
return it to the caller (or store it into globals) as any other PMC.
Which implies that the whole call chain (with its contents) would have
to be kept alive.
-- c
leo