Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

vtables as collectable objects

5 views
Skip to first unread message

Dan Sugalski

unread,
Mar 4, 2004, 10:06:01 AM3/4/04
to perl6-i...@perl.org
It'd be simple enough to do--prepend a PObj front to the vtables and
allocate the vtables themselves out of a separate managed arena, and
do a bit of custom mark noting. This'd make collecting up unused
vtables easy enough. The downside to this is it means we add in a
*lot* of extra pointer traversal, as we add in an extra live pointer
for every live PMC in the system.

It's a lot of extra work for the DOD. I'm up for it if we have to,
but I'd prefer to not do it if we don't have to.

Opinions, folks?
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

Leopold Toetsch

unread,
Mar 4, 2004, 10:51:57 AM3/4/04
to Dan Sugalski, perl6-i...@perl.org
Dan Sugalski wrote:

> It'd be simple enough to do--prepend a PObj front to the vtables and
> allocate the vtables themselves out of a separate managed arena, and do
> a bit of custom mark noting. This'd make collecting up unused vtables
> easy enough. The downside to this is it means we add in a *lot* of extra
> pointer traversal, as we add in an extra live pointer for every live PMC
> in the system.
>
> It's a lot of extra work for the DOD. I'm up for it if we have to, but
> I'd prefer to not do it if we don't have to.

Rather not. But if we have to allocate a separate vtable, we should set
a flag in the vtable->flags, mark the PMC as special, so that destroy
can free the vtable.
leo


Dan Sugalski

unread,
Mar 4, 2004, 11:00:04 AM3/4/04
to Leopold Toetsch, perl6-i...@perl.org

That works for one-off vtables, but doesn't work in the case of
shared vtables. Those may happen if we allow unloading of classes,
but I think I've a way around that one. I think.

Leopold Toetsch

unread,
Mar 7, 2004, 1:18:45 PM3/7/04
to Dan Sugalski, perl6-i...@perl.org
Dan Sugalski <d...@sidhe.org> wrote:
> At 4:51 PM +0100 3/4/04, Leopold Toetsch wrote:
>>
>>Rather not. But if we have to allocate a separate vtable, we should
>>set a flag in the vtable->flags, mark the PMC as special, so that
>>destroy can free the vtable.

> That works for one-off vtables, but doesn't work in the case of
> shared vtables. Those may happen if we allow unloading of classes,
> but I think I've a way around that one. I think.

The we'll make the flag bigger and call it refcount :) Shared (COWed)
resources *have* a refcount during DOD anyway.

> Dan

leo

0 new messages