Re[2]: [Gc] Recompiling libgc 7.1

Ivan Maidanski ivmai at mail.ru
Fri Dec 12 02:10:58 PST 2008


Hi!

Christophe Meessen <meessen at cppm.in2p3.fr> wrote:
> 
> Hello,
> 
> thank you very much for answering. Unfortunately I will only be able to 
> test this tomorrow.
> I wasn't aware of the existence of a version 7.2a1.
> 
> 
> Ivan Maidanski a e'crit :
> > Hi!
> >
> > Christophe Meessen <meessen at cppm.in2p3.fr> wrote:
> >   
> >> I also had allot of problems earlier with STL and GC. I had to use the 
> >> gc_allocator with STL containers to make sure their content gets collected.
> >> It might be related to the previous problem.
> >>     
> >
> > What are these problems?
> >   
> Well the problem could be linked to this one.
> On my previous laptop I could compile and run the program without any 
> compilation warning about new. But I had memory leaks. It took me a 
> month to find out that the problem came from the STL containers.
> I forgot what I did initially. I now suspect I added a define to disable 
> the new[] array stuff. I got rid of warnings but introduced the memory 
> leak with containers.
> 
> To solve this I had to add gc_allocator to all containers (vectors and 
> even strings) to be sure the internal allocated buffers where properly 
> cleaned up. This problem occurs when my heap allocated objects contain 
> such STL containers as member variables. Since the destructor is not 
> called, the STL containers would not be cleaned up.
> 
> If I add the #include <new> before gc_cpp will it ensure that memory 
> allocated by containers will be collected ? If yes, this would be great.

I don't think so. Anyhow, I'm not using gc with c++ so I can't help You with this problem. May be someone else (on the mailing list) could.

> 
> Thank you very much for the hint. This could solve allot of troubles I 
> had so far.
> >> Any clue how this should be resolved ?
> >>     
> >
> > My first suggestion - try the latest (7.2a1) version of GC (from CVS).
> >   
> I'm not good at extracting CVS releases. I always installed the tar ball 
> packages only.

For Windows, the latest CVS snapshot is definitely more preferable than v7.1.
But, there's no tarball for it yet. I'm personally using CvsNT to fetch cvs snapshot.

> 
> 
> Thanx anyway.
> 

Bye.



More information about the Gc mailing list