Graham Barr <[EMAIL PROTECTED]> wrote:

> I may be missing something here. But within the resources of an object may
> be other PMCs. As those PMCs will not be referenced from anywhere else
> what is to stop the DoD run from freeing those before it freed the object ?

If the PMC has explicit knowledge of an related PMC, the destroy can be
done in the correct order. But I think, the (higher level) cleanup will
be done at a higher level anyway, either in Parrot objects or in Perl6.

But even if we can't assure a correct order and one PMC has to call
another one (which might already be "freed", then it would be possible
to do the cleanup: We don't free PMCs, we just set a flag (on_free_list)
and put it on the free list. So when the relevant data of the PMC are
behind sizeof(void *) from the beginning of the PMC it could still be
used.

> Graham.

leo

Reply via email to