An alternative for the deprecated __malloc_hook functionality of glibc
After trying some things, I finally managed to figure out how to do this. First of all, in glibc, malloc is defined as a weak symbol, which means that it can be overwritten by the application or a shared library. Hence, LD_PRELOAD is not necessarily needed. Instead, I implemented the following function in a shared … Read more