Overriding new and delete

Jun 14, 2014 at 12:24pm
I'm experimenting with a custom memory-pool for my application, and I initially planned to override the global new and delete operators to allocate memory in this pool. But since I'm using QT, this will apply to all the QT-related stuff as well. Is this a good idea or not? Should I instead just override the new and delete operators per class?
Jun 14, 2014 at 2:41pm
> Should I instead just override the new and delete operators per class?

Yes.

Ideally write a common helper class which can then be reused by all the classes that need pool allocation.
Jun 14, 2014 at 5:43pm
Yeah, I've written a singleton memorypool-class that the new- and delete-operators would then get their memory allocated from.
Topic archived. No new replies allowed.