C++ / Overloading 'new'
Here''s the situation:
In order to cut down on memory thrashing, I worte my own memory manager to alloc huge blocks and lock them into physical memory. This is all well and good for structures and data chunks, but now I need to overload my ''new'' operator for several of my classes to improve performance. So my questions are the following:
-do I need to explicitly call the constructor for each class
in the overloaded new function?
-If I have multiple constructors for a single class, do I need to overload new for every single one?
-Do I need to explicitly handle inheritance?
The Timdog
Simple answer... no to all of the above. Don''t forget to override the delete operator too. In case your curious the constructor gets called after the call to new and the destructor gets called before the call to delete.
Torval
Torval
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement