Article ID: 140858 - Last Review: June 2, 2005 - Revision: 4.0 The _CRTDBG_MAP_ALLOC macro does not work as expectedThis article was previously published under Q140858 On This PageSYMPTOMS
When an object is allocated through use of the New operator and dumped
through use of the debugging routines in the C Run-Time Library, the
allocation is reported as occurring in the Crtdbg.h file line 512.
CAUSE
This is caused by the definition of the overloaded operator New in the
Crtdbg.h file:
MORE INFORMATION
The Books Online section titled "Using the Debug Heap from C++" in the
Run-Time Library Reference states that defining the _CRTDBG_MAP_ALLOC
symbol causes all instances of New in your code to be mapped properly to
the debug version of New so as to record source file and line number
information. While it is true that this will map calls to the debug version of New, it will not store the proper source file or line number information. There are two ways to mark the correct file name and line number:
Sample CodeAPPLIES TO
| Article Translations
|
Back to the top
