Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6931481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:34:59+00:00 2026-05-27T11:34:59+00:00

The MSVC memory manager has certain hexidecimal codes it uses in debug builds to

  • 0

The MSVC memory manager has certain hexidecimal codes it uses in debug builds to mark memory depending on what operation was performed. These are documented here.

In particular, the code 0xCDCDCDCD is used to mark allocated but uninitialized heap memory. Suppose I have the following structure:

struct Test
{
   bool foo;
   int value;

   Test() : foo(false), value(0) {}
};

When I allocate this object, will my memory look like this (note that I am writing out the hexidecimal bytes as they would appear in-order, endianness hasn’t been considered for this example)?

00 CD CD CD CD 00 00 00 00

Above, 00 CD CD CD represents the 4-byte aligned boolean. The last 3 bytes are 0xCD because the memory manager initialized those values to CD, however the actual initialization of that boolean in the structure only touches 1 byte since a boolean represents only 1 byte on my machine.

Is this the correct behavior?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:35:00+00:00Added an answer on May 27, 2026 at 11:35 am

    Just try it. Make sure to compile with /MDd or the like to link to the debug runtime. (The answer is yes in VS2010).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When dealing with random memory overwrites, in MSVC it is possible to validate the
In msvc, I have functions like this and it builds but in gcc it
I'm porting an msvc project, which has several libraries and each library has specific
This is in MSVC# 2008. I wrote a simple usercontrol that has 2 labels,
I try to enable msvc memory leak detection with line number like this snippet
In MSVC, DebugBreak() or __debugbreak cause a debugger to break. On x86 it is
With msvc, is there an equivalent to gcc's __builtin_return_address? I'm looking to find the
i did this in msvc 2005. typedef void (*cleanup_t)(); void func(cleanup_t clean) { cleanup_t();
I know MSVC can do this via a pragma message -> http://support.microsoft.com/kb/155196 Does gcc
I want to use MSVC compiler to build a DLL file. The problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.