memory leaks finding helper library


This library (in fact a .c and .h file which can be linked to your application)

How to use

Instead of malloc(), realloc(), free and strdup() you now should use myrealloc(), myrealloc(), myfree() and mystrdup().
Also, these functions require an extra parameter. This parameter is a pointer to a 0x00 terminated string containing a descriptive text explaining what is allocated. Of course you're free to put in what you like but it helps yourself if it is not ambigues.
Now when you would like to know what is allocated by whom, call dump_mem(). This dump_mem() function can also be used as a signal handler for SIGHUP. dump_mem() writes the current status to a file called 'log.log' in the current working directory.




The Lotter allows you to participate in lotteries from all over the world!