[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] GC and refcount

From: strk
Subject: Re: [Gnash-dev] GC and refcount
Date: Mon, 21 Dec 2009 18:32:12 +0100

I've created a new shared branch for the GC work:
 bzr branch

The GC version in the branch allows "manual" deletion of GcResource
objects by having GcResource destructor remove self from the GC-managed
list. Cost of this is + sizeof(std::list::iterator) per GcResource.
Removal from the std::list runs in constant time.

Now that we have that possibility, adding a ref-count in GcResource
would let us remove earlier any object not containing circular refs.
Only trouble would be making sure intrusive_ptrs for GcResource
are properly used within the whole codebase. 
The SafeStack implementation would need to stop keeping as_value
alive in order for memory reduction to be noticeable.


On Sat, Dec 19, 2009 at 12:17:43PM +0100, strk wrote:
> Here's another idea to reduce memory use.
> We could mix refcount and gc for the GcResources
> so that in absence of circular refs we'll release
> them sooner.
> The additional overhead would be:
>       - refcount management  (per reference)
>       - GC list  management (per object)
> Implementation:
>       - manage GcResources with intrusive_ptr<>
>         like others.
>       - Tweak add/drop refs for GcResource in libbase/smart_ptr.h
>       - Tweak GcResource to add refcount and signal GC
>         about being removed.
> --strk;
>  Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign
>  /\  Keep it simple! 
> _______________________________________________
> Gnash-dev mailing list
> address@hidden


 Free GIS & Flash consultant/developer      ()  ASCII Ribbon Campaign  /\  Keep it simple! 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]