Search the web
Sign In
New User? Sign Up
dmalloc · Debug Malloc Library (dmalloc) Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
C++ improvement   Message List  
Reply | Forward Message #119 of 529 |
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







Mon Feb 7, 2000 7:59 am

mammal@...
Send Email Send Email

Forward
Message #119 of 529 |
Expand Messages Author Sort by Date

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...
Stanislav Kutil
mammal@...
Send Email
Feb 7, 2000
2:38 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help