(There were at least 4-5 topics with a similar topic on SO. I read each of them and I don't feel they really help me with this specific issue).
I'm using Visual Studio .NET 2003 on Windows 7.
I have my own overloads of new/delete that point to my own custom calls to malloc()
and free()
for diagnostics. My new/delete overloads are in a header file which I've included in a few files.
The problem is, the code base is pretty much spaghetti and there is no easy way to make sure these overloads get used by everything. There are includes to third party libraries that are black-box. We also use STL everywhere.
In my tests I've found that STL is still mixing calls to my own new/delete and the standard MSVC new/delete calls.
It doesn't seem realistic to include my header file in thousands of other files, that would just take far too long. Can anyone offer some tips on how to properly and effectively overload new/delete globally so everything uses my custom memory manager?