Mail Archives: djgpp/1997/12/03/02:01:28
On Tue, 02 Dec 1997 13:17:11 -0500 in comp.os.msdos.djgpp A. Sinan Unur <sinan DOT unur AT cornell DOT edu> wrote:
: do a
: #ifdef DEBUG
: #define malloc my_debug_malloc
: #define realloc my_debug_realloc
: #define free my_debug_free
I did something like this to make a simpler memory-leak detector
(http://users.ox.ac.uk/~mert0407/downloads/findleak.zip). It's more
useful IMHO if you do something like this:
#define malloc(x) my_debug_malloc(x,__FILE__,__LINE__)
etc
Then you can output the source filename and line number to the debug
file too, and match up the calls to the source code more easily.
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
- Raw text -