Thanks man for the very very nice code.
However, I am trying to create a version which works for C++ operators new and delete like this:
#define new (elemSize) MyNew (elemSize, __FILE__, __LINE__)
#define new (elemSize) MyNewArray (elemSize, __FILE__, __LINE__)
#define delete(memPointer) MyDelete (memPointer)
#define delete (memPointer) MyDeleteArray (memPointer)
and I get the following compiler errors:
24:1 [Warning] "new" redefined
26:1 [Warning] "delete" redefined
Can you think of a workaround for this? Thanks.