CRT Debug support – The Magic Memory values.

29 04 2008


Memory corruptions are every programmer’s nightmare. But Debug Heap provides some facility in debug build to help you to get rid of those memory corrupting problems. Depending to the type of memory allocation we have done, the debug heap will fill some magic value for the allocated memory contents. Take care that, this will be available only in debug build. Please see below.

  1. 0xCD – The memory locations filled with this magic number are allocated in heap and is not initialized.
  2. 0xFD – This magic number is known as “NoMansLand”. The debug heap will fill the boundary of the allocated memory block will this value. If you are rewriting this value, then it means, you are beyond an allocated memory block.
  3. 0xCC – The memory locations filled with this magic number means, it’s allocated in stack but not initialized. You can see this when you a variable on stack and look at its memory location. You can use /GZ compiler option to get the same feature in release build.
  4. 0xDD – The memory locations filled with this magic number are Released heap memory.


Regarding the 4th one – 0xDD, when I tried, the deleted memory locations are filled with 0xFEEE. I’ve to check it further. as per documentation its 0xDD.


Targeted Audience – Intermediate.

Advertisements

Actions

Information

One response

8 11 2008
ice-3.3.0-VC90: enumerator out of range - ZeroC Forums

[…] == 0xCD … since you’re using Visual C++, an uninitialized value seems very likely. See CRT Debug support – The Magic Memory values. Visual C++ Tips Best regards, Bernard __________________ Bernard Normier ZeroC, […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: