This project is intended as a drop in replacement for the standard malloc library, primarily for finding and "corking" memory leaks.
This project was created in 1999 after I found that dmalloc's allocation history was insufficient for my needs. M-Cork is intended primarily to address memory leaks, although it has a memory scanning feature that can be used to detect memory buffer overflow and underflow problems after they occur.
It represents two advantages over dmalloc -- and these were the motivating factors for the creation of M-Cork:
1 | Thus, the program/programmer need not release every block of memory that the daemon allocated at start up; in my case that was in the hundreds of allocations. Admittedly this is a bit sloppy, but the timeline was very, very tight and not all allocations were in code to which I had access. Your experiences may be the same! |
2 | If you have utility classes or functions that do the actual allocation, M-Cork will show the location of the code that called the utility class, allowing meaningful debugging. This is controlled by the value of NSF ( Number of Stack Frames), you can either add "NSF=8" (for example) onto the configure command line, or set the environment variable NSF before running configure . |