Inside CRT: Debug Heap Management
When you compile a debug build of your program with Visual Studio and
run it in debugger, you can see that the memory allocated or
deallocated has funny values, such as...
0xCC When the code is compiled with the /GZ option, uninitialized
variables are automatically assigned to this value (at byte level).
Magic Number on Wiki:
CCCCCCCC Used by Microsoft's C++ debugging runtime library to mark
uninitialised stack memory
In Visual Studio CRT Source, \VC\crt\src\malloc.h
:
#define _ALLOCA_S_STACK_MARKER 0xCCCC
// ...
#undef _malloca
#define _malloca(size) \
__pragma(warning(suppress: 6255)) \
((((size) + _ALLOCA_S_MARKER_SIZE) <= _ALLOCA_S_THRESHOLD) ? \
_MarkAllocaS(_alloca((size) + _ALLOCA_S_MARKER_SIZE), _ALLOCA_S_STACK_MARKER) : \
_MarkAllocaS(malloc((size) + _ALLOCA_S_MARKER_SIZE), _ALLOCA_S_HEAP_MARKER))