0xcdcdcdcd - Created but not initialised
0xdddddddd - Deleted
0xfeeefeee - Freed memory set by NT's heap manager
0xcccccccc - Uninitialized locals in VC6 when you compile w/ /GZ
0xabababab - Memory following a block allocated by LocalAlloc()
VC++在Debug编译方式编译的程序中,会跟踪用new分配的内存。新分配的内存会用0xcd(助记词为Cleared Data)填充,防止未初始化;当它被delete后,又会被0xdd(Dead Data)填充,防止再次被使用。这样有利于调试内存错误。之所以选这样的填充模式,是因为:
1.大数,若被当成指针就会越界
2.奇数,指针通常指向偶数地址
3.非0,这样不会和 NULL 混淆。
在Release版中不会有这些字节填充。