Paul Nettle's memory tracker mmgr and C++11

Started by
10 comments, last by nfactorial 10 years ago


And im the only one who posted a potential solution that work.

This is obviously just an example, where deleting the default constructor is superfluous. However, there's a difference between deleting an automatically generated function, and declaring, but never defining, a function. I don't think that's a drop-in replacement.

Advertisement

As Hodgman says, every engine I've worked with does not use new and delete directly. Instead they define their own macro. Such as MY_NEW (using Hodgmans example).

So code then becomes:


MyObject *myObject = MY_NEW MyObject();

Where MY_NEW would be defined something like:


#if defined( _DEBUG )
    #define MY_NEW    new( __FILE__, __LINE__ )
#else
    #define MY_NEW    new

#endif //defined( _DEBUG )

This topic is closed to new replies.

Advertisement