今天,我找到了有关内存泄漏检测的源代码,并且在他的头文件中,我找到了以下宏定义,有人可以告诉我这是什么意思吗?谢谢!
#ifndef MC_NO_REDEFINITION
#define new MC_NEW
#define MC_NEW new(__FILE__,__FUNCTION__,__LINE__)
#define mc_new new
else
//use defined function name instead of keyword new & delete
#define debug_new new(__FILE__,__FUNCTION__,__LINE__)
#endif
Run Code Online (Sandbox Code Playgroud)
这意味着new表示new(__FILE__,__FUNCTION__,__LINE__)
,如果这是真的,那么当我在代码中使用new时,编译器如何知道我真正想要调用的东西?