To whom it may be useful.
I noticed that when using C++ style allocation (new, new[]) file and
line information is not being tracked. This is a little improvement
that may work for some compilers.
in dmalloc.cc, overload placement new operators like this:
void * operator new (size_t size,char* filename,int line) {
return _malloc_leap(filename,line,size);
}
void * operator new[] (size_t size,char* filename,int line) {
return _malloc_leap(filename,line,size);
}
and add these lines in dmalloc.h:
#define NEW new(__FILE__,__LINE__)
void * operator new (size_t size,char* filename,int line);
void * operator new[] (size_t size,char* filename,int line);
#define new NEW