C++ object layout browser - by A.M._

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 349829 Comments
Status Closed Workarounds
Type Suggestion Repros 0
Opened 6/7/2008 10:03:46 AM
Access Restriction Public

Description

It would be extremely useful to be able to see the memory layout of C++ objects and their size. Knowing the layout for each object would make it easier to optimize memory footprint and create better-aligned objects.

It would also be a great feature if the class list could be sorted by object size (i.e. sizeof(x)).
Sign in to post a comment.
Posted by A.M._ on 8/22/2008 at 4:56 AM
You handling of this suggestion is a good example of why Microsoft is losing the battle with the Open Source world. Keep rejecting good suggestions and VS will end up where IE is.
Posted by Microsoft on 7/24/2008 at 3:19 PM
That is my fault; I incorrectly marked the bug when I was resolving it in our tool. I've reactivated your bug and will resolve it as Won't Fix shortly.

Peter-Michael Osera
Visual C++ Compiler Team
Posted by A.M._ on 7/24/2008 at 3:12 PM
You cannot mark as Fixed something you just turned down for whatever reason. You should have a special code for this, so you know what was actually fixed and what was deferred/rejected.

Unless, of course, the goal is to inflate the number of fixed bugs.
Posted by Microsoft on 7/23/2008 at 1:02 PM
Thank you for your feedback!

This is a feature request that we receive with some frequency. However, in our product planning for this release, we were not able to find the time to add this functionality to the class browser. Rest assured, we will be putting this back on the table for the future versions of Visual Studio.

In the mean time, you can use the undocumented (and unsupported) compiler switches /d1reportSingleClassLayout<class> and /d1reportAllClassLayout to get the information you want from your build. For more information on these switches, please read Andy's excellent blog post: http://blogs.msdn.com/vcblog/archive/2007/05/17/diagnosing-hidden-odr-violations-in-visual-c-and-fixing-lnk2022.aspx

Peter-Michael Osera
Visual C++ Compiler Team