new and delete operator overloading for dll

前端 未结 2 726
有刺的猬
有刺的猬 2021-01-06 07:22

How to overload new and delete operator for a dll. I have written overloaded operators as part of the dll , but client linking with th

2条回答
  •  爱一瞬间的悲伤
    2021-01-06 08:06

    You could try and write your own malloc and delete functions and then create a C definition that basically contains the code to override new and delete and call these custom malloc and delete functions.

    This way you could do something such as

    MODULE_START()
    // CODE HERE
    
    MODULE_END()
    

    and this should work smoothly.

提交回复
热议问题