While trying out some memory tracking and preparation for my own memory manager, I tried to override the new operator. The article on flipcode was my main guideline in this proc
On Visual Studio 2010, I was able to do this without redefinition of new or custom defined new. I created a header file with the following:
#pragma once
//_CRTDBG_MAP_ALLOC
//_CRTDBG_MAP_ALLOC_NEW
#define _CRTDBG_MAP_ALLOC
#define _CRTDBG_MAP_ALLOC_NEW
#include
#include
and forced its inclusion on every source file, with the already discussed option Forced Include File, in the Project Settings / Configuration Properties / C/C++ / Advanced. Actually, crtdbg.h already do this custom definition of new, along with undefinition of regular new. And just to make sure everything would run smoothy, I added _CRTDBG_MAP_ALLOC and_CRTDBG_MAP_ALLOC_NEW to Preprocessor Definition list, available in: Project Settings / Configuration Properties / C/C++ / Preprocessor.
Hope this will help on this issue.