Home Dashboard Directory Help
Search

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


Status: 

Closed
 as Won't Fix Help for as Won't Fix


1
0
Sign in
to vote
Type: Suggestion
ID: 349829
Opened: 6/7/2008 10:03:46 AM
Access Restriction: Public
0
Workaround(s)
view

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)).
Details
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
Sign in to post a workaround.