Just an FYI, you can make you code work without having to change existing code.
1) Do it like electric fences does (or use electric fence: emerge efence) and write a static library where you write your own malloc, calloc, realloc that call _malloc, _calloc, _realloc respectively. (IIRC on the naming convention of the internal functions). And then just re-link with your new library and you'll get you malloc, calloc, realloc functions. I've done this before, btw, I know it works.
2) Do the above but make it a shared libary and set LD_PRELOAD=mylib.so and no relinking is needed, so it could be used on -any- executable not just your own.
Just some tips.
|