A simple alternative to valgrind/memcheck that keeps track of malloc'd, calloc'd, realloc'd, and free'd memory and prints a diagnostic message at the end of program execution.
src | ||
CMakeLists.txt | ||
LICENSE | ||
README.md |
AnotherMemCheck
This software was created as an alternative to valgrind/memcheck.
Usage
-
Build this software with cmake.
-
Assuming the output library is called
libAnotherMemCheck.so
, run your program with theLD_PRELOAD
environment variable set to this library.LD_PRELOAD=path/libAnotherMemCheck.so ./myProgram
-
When the program exits, there should be diagnostic output from this library showing all memory that has been
malloc
ed and notfree
ed. Note that some memory will always be shown as having been notfree
ed (e.g. initializing heap stuff for the program at start).