[Gc] Re: Memory leak located!

Hans Boehm Hans.Boehm at hp.com
Sat May 24 14:15:34 PDT 2008


This is probably not a bad idea, but it significantly changes the current 
interface, which has new allocate collectabe memory only when requested.

Whether or not it really fixes the allocator problem depends on whether 
the default allocator calls new directly or allocates large chunks with 
new and then divides them.  I believe it's still common to do the latter. 
In that case, this change will probably help, but possibly only in the 
sense that it hides the underlying bug for longer.  My recommendation 
would still be to explicitly use a garbage collecting allocator whenever 
possible.

Maybe the right solution is to introduce yet another macro, say 
GC_COLLECTABLE_NEW that controls the behavior of global operator new?

Hans

On Sat, 24 May 2008, Martin Wartens wrote:
> Since you have rediscovered an issue that was already discussed a lot 
of times
> here, I wonder if you have patched your gc_cpp.cc, as you most likely want to
> do.
> There, all instances of GC_MALLOC_UNCOLLECTABLE have to be replaced by
> GC_MALLOC. Otherwise new is not handled by the garbage collector. This also
> fixes the allocator problem.
>
> Regards,
> Martin Wartens
>
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
>


More information about the Gc mailing list