Nothing is impossible for the person who doesn't have to do it.

Aug 24, 2006 02:29

Overriding the "new" operator in C++ can be tricky. If you have any globals that call new in their constructors, there are issues with things like global initialization order. Seemingly innocent things like "if (GFoo)" aren't reliable if GFoo is a global...

Also, new has to be re-entrant if your application does any multithreading. Thankfully, a simple critical section will do just fine except in pathological cases. (But then, if your app is doing that much memory allocation in different threads at run-time, there are more important problems to solve than new/malloc performance.)
Previous post Next post
Up