DEPRECATED: improved version available here
Keep an eye on every heap operation that happens in your program and spot memory leaks.
- malloc(), free(), calloc() and realloc() supported.
- Detect where memory leaks happened.
- Spot allocation functions misusage (e.g. asking malloc() to allocate zero bytes)
- Quick and easy integration in your project.
- Exstensive documentation.
- No dependencies.
- Link the library to your project.
- At your project's root include something like this:
#include "cmonitor/cm.h"
/* enable monitoring */
#if defined(_DEBUG) || !defined(NDEBUG)
# define malloc cm_malloc
# define free cm_free
# define calloc cm_calloc
# define realloc cm_realloc
#endif
- Done! That's it!
You can find more examples in the examples folder