什么是对象/结构体等的C ++内存布局? [英] What is the C++ memory layout of objects/structs etc?
问题描述
我非常想学习如何表示对象和其他C ++实体(结构体等)物理内存(我知道列表是节点到节点和数组是连续的内存 - 但所有其他方面的语言)。
编辑: x86汇编器帮助这个和理解C ++更好?
是的,标准没有说明对象将在存储器中表示。要了解normall C ++对象的表示方式,请阅读本书: C ++对象模型。
In C++ I presume the C++ standard has nothing to do with how data members are arranged within a class, in terms of memory layout? Would I be right in thinking this is down to the compiler in question?
I'm very interested in learning how objects and other C++ entities (structs etc) are represented in physical memory (I know things like lists are node to node and arrays are continuous memory- but all the other aspects to the language).
EDIT: Would learning x86 assembler help with this and understanding C++ better?
Yes, the standard doesn't say how the objects are to be represented in memory. To get an idea how normall C++ objects are represented read this book: inside C++ object model.
这篇关于什么是对象/结构体等的C ++内存布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!