The information in this article applies to:
SYMPTOMSWhen 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. CAUSEThis is caused by the definition of the overloaded operator New in the Crtdbg.h file:
Here __FILE__ and __LINE__ are macros defined by the compiler that report
the current file name and line number. Macros are filled out by the
preprocessor. Then the compiler replaces your call to New with this
function. Therefore, the macros have already been filled out before they
are inlined. Hence they will report the header file information.
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.
-or- Sample Code
Additional query words: kbCRT kbOLDocs kbDSupport
Keywords : kbdocerr kbVC400 kbVC410 kbVC500 kbVC600 |
Last Reviewed: September 16, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |