4 ms·
Just a feature idea: I'd love an IDE plugin (for something like visual studio or eclipse) that would show this sort of information. Sort of like a disassembly,
by overgard 13y ago
Just a feature idea: I'd love an IDE plugin (for something like visual studio or eclipse) that would show this sort of information. Sort of like a disassembly, but for structs instead. I can imagine lots of industries where they'd pay for that sort of thing (IE, game programmers or OS developers, etc.)
- aidenn0 13y agoEmbedded IDEs already do this (showing the offsets of elements in a structure in a column when you are viwing structs).
- hdevalence 13y agoIt's not exactly what you're looking for, but clang can give you record dumps of C and C++ structs and classes. (In general, clang has lots of interesting tooling for C and C++, and I highly recommend looking into using it). I wrote here [1] about using it in a KDE program (KStars) to cut 10% off the memory usage. In particular you can also use this tool to see some of the many bad effects of deeply nested classes: your class may be 8-byte aligned, so a 'char' at the end can take up eight bytes with padding, and it's not possible (AFAIK) to rearrange fields up and down inheritance heirarchies [2]. [1]: http://www.hdevalence.ca/blog/2013-12-22-better-living-through-clangistry http://www.hdevalence.ca/blog/2013-12-22-better-living-throu... [2]: C++ is not my favorite programming language.