Friday, March 23, 2007

Debugging Memory Value Meanings

The Visual Studio compiler automatically assigns default values to certain types of variables depending on how they were declared (stack based vs heap based) and what types of variables they are (pointers etc). These values become very useful during debugging because you can tell what went wrong when an exception is thrown. Here are some common values and their meanings:

  • 0xfeeefeee - Memory reserved to heap allocation but has not been allocated yet
  • 0xcdcdcdcd - Uninitialized heap variable (Think of the "C" as Clean memory)
  • 0xcccccccc -Uninitialized stack variable (Think of the "C" as Clean memory)
  • 0xfdfdfdfd - Padding around an array (Think of the "F" as Fences around your variable)
  • 0xdddddddd - Released heap variable (delete or free) (Think of the "D" as in Dead)

No comments:

Post a Comment