On Dec 5, 2005, at 12:27 PM, Jeremy White wrote:
Although not because of Valgrind, I ended up moving all of my
memory allocation into separate global functions. So I now have:
mymodule_malloc
mymodule_free
mymodule_realloc
This made tracking memory issues with Valgrind very simple.
It seems like you could do this with macros, no? Throw in an #ifdef
DEBUG that defines mymodule_malloc as a wrapper function, with an
#else clause that defines it as New.
I'm having a bit of trouble figuring out how to pass around the 4th
arg to New, the cast. What do your memory allocation functions look
like?
Marvin Humphrey
Rectangular Research
http://www.rectangular.com/