[Gc] Using C++ Standard Template Library with GC

teelf@nymph.kyndig.com teelf@nymph.kyndig.com
Sun, 9 Nov 2003 15:23:48 -0600 (CST)

I was also having problems with classes derived from gc being used in STL 
containers.  I recompiled the collector with 
-DREDIRECT_MALLOC=GC_malloc_uncollectable and it has been working on my 
linux 2.4.9 system.  

Is this another way of solving the STL problem? Or is there going to be 
problems later on down the road when my application gets more thoroughly 

Also, I think there is a small typo in the comments at the top of the page 
in gc_alloc.h and new_gc_alloc.h.  It recommends using 
GC_uncollectable_malloc which should be GC_malloc_uncollectable.

In response to an email from David Jones on 30 Oct 2003:
>The basic problem is that STL containers need to allocate memory, and by 
>default they do so in the "malloc heap", which is neither scanned nor 

>You need to allocate from a collectible heap.