Multiple Thread Override Method

I implemented my own memory manager, and I redefine the new and delete statements as follows:

/** Override the Standard C++ new operator */ void* operator new (size_t size); /** Override the Standard C++ delete operator */ void operator delete (void *p); 

This works fine, but now I am developing in a multi-threaded environment with a lot of heap. To avoid heap conflicts, I want each thread to have its own instance of a memory manager. How to force the operator to override the point in the memory manager instance for this thread?

+4
source share
1 answer

Local thread storage can be used.

+1
source

All Articles