VC++ Debug内存值
Memory Values
If you're using the debug heap, memory is initialized and cleared with special values.
Typically MFC automatically adds something like the following to your .cpp files to enable it:
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
While using the debug heap, you'll see the values:
Value | Usage |
---|---|
0xCDCDCDCD | Allocated in heap, but not initialized |
0xDDDDDDDD | Released heap memory. |
0xFDFDFDFD |
"NoMansLand" fences automatically placed at boundary of heap memory. Should never be overwritten. If you do overwrite one, you're probably walking off the end of an array. |
0xCCCCCCCC | Allocated on stack, but not initialized |
希望大家能把自己的所学和他人一起分享,不要去鄙视别人索取时的贪婪,因为最应该被鄙视的是不肯分享时的吝啬。