Memory allocation debugging
Sometimes it’s beneficial to see the actual memory allocations done by an app, but you don’t want to code a full memory allocation system. Perhaps you cannot even rebuild the app.
Then a good option is to use a dynamic library to override all the allocation functions.
The idea is simple, make sure the application finds your library before any other, and let it use the custom malloc-functions. Here is the source
On MacOS, you’ll use
|
|
and on Linux:
|
|
The result will look like this:
|
|