[Gc] Memory leak located (corrected error in Map)!

Christophe Meessen meessen at cppm.in2p3.fr
Sat Apr 26 16:24:36 PDT 2008


Sorry, I made an error with std::map.

Christophe Meessen a écrit :
> For the map, instead of
>   std::map< KeyType, MyType >
>
> one has to write 

std::map< KeyType, MyType, std::less< KeyType >,
       gc_allocator<std::pair< const KeyType, MyType> > >

Note that this is only required when used for member variables of a 
class without finalizer.

An example of these on the libgc web site would have saved me hours of 
work to locate the memory leak. It was not obvious from the current 
documentation.


More information about the Gc mailing list