guys,
If I override the global new and delete in my dll code, will this override the user code new and delete?
I made a test, and it shows the user new and delete will not be impacted.
If I want to make user code new and delete be replaced by mine sdk new/delete, how to do that.
What’s the case of template class. Template class definition includes some new/delete. And user code might instantiate it. Then, it might use user new/delete, right?
No, on Windows each DLL has its own
operator new()/operator delete(). However you should be careful – if some DLLnews an object that object should bedeleted using the sameoperator delete()– otherwise you run into undefined behavior.