Wednesday, August 17, 2005

Magic Numbers for Debugging Memory troubles

I got tired of searching for this each time I needed to so here it is -- the magic memory values when using the debug heap in Microsoft Visual C++ 6.0, 2003 and presumably 2005.

Culled from here and here.

0xBAADF00D -- Allocated by HeapAlloc, not yet used by malloc
0xCDCDCDCD -- Allocated but uninitialized
0xFDFDFDFD -- No mans land. Surrounds allocated block
0xABABABAB -- 2 words following allocated block's no mans land
0xDDDDDDDD -- In the process of being freed.
0xFEEEFEEE -- Freed

[Listening to: Kittie - Suck (Live)]

No comments: