The Microsoft Runtime Library provides a debug version of the distribution functions. For C ++, this is a debugging option for the new operator with a signature:
void *operator new(size_t size, int blockType, const char *filename, int linenumber);
and the macro is defined as
#define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
Now, to measure all distributions, it is usually determined
#if defined DEBUG_NEW #define new DEBUG_NEW #endif
However, this definition breaks down any place that uses the new location because two sets of arguments become a syntax error. Now I can easily handle several uses in our code, but the standard library and speeding up the use of placement is ubiquitous. Thus, defining this globally means including a lot of material before defining and slows down compilation.
So, is there any way to distribute the tools in our code without pulling out the headers just because they contain a new location and should not either put the last definition higher in all files or manually write DEBUG_NEW?
source share