[Gc] How detect leak in C++ application ;

Renato Tegon Forti re.tf at terra.com.br
Tue Jan 29 08:32:17 PST 2008


Hi All,

 

How detect leak in C++ application ;

 

Any sample?

 

I did try this but any leak is detected.

 

#define GC_PRINT_STATS 

 

#include <iostream>

#include <leak_detector.h>

 

struct A{

      int a;

      long b;

};

 

int main() 

{

      A *p[100];

 

      int i;

 

      GC_find_leak = 1;

 

      for (int i = 0; i < 100; i++)

      {

            p[i] = new A;

      }

 

      CHECK_LEAKS();

 

      return 0;

}       

 

 

-----

Renato Tegon Forti

Knowledge gets doubled when shared. 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20080129/d0335020/attachment.htm


More information about the Gc mailing list