On Oct 27, 2005, at 17:45, Patrick R. Michaud wrote:

On Thu, Oct 27, 2005 at 05:28:36PM +0200, Leopold Toetsch wrote:

The return result of the compilation (an Eval PMC) isn't stored anywhere
and get's GCed. This also kills the compiled subroutine.

FWIW, I think the "natural" expectation is that a compiled sub (and its
associated Eval PMC) will both remain alive through the global symbol
table entry until it's released -- either by removing the symbol table
entry or replacing it with a different PMC.

So be it now. I've updated the sub structure to contain an eval_pmc field, which is used to mark a "surrounding" eval PMC . Therefore a sub in compiled code should now only die, when the global entry is replaced or removed. The rule for :anon subs remain the same, as these aren't DOD-anchored anywhere except in the returned code object (the Eval PMC).

This creates a nice reference loop as a Sub marks the Eval PMC and vice versa. But due to our non-refcount based GC this isn't a problem ;-)

Pm

leo

Reply via email to