[Study Notes] Sequence and Alignment of Data Storage_Computer Principles
I have opened a new pit and made a reading note on computer principles for my own use and for sharing only.
The order in which data is stored
IntroducedMachine-side mode
Data storage alignment
What is introduced here is that the storage method of the data structure is aligned according to the given bytes and its own bytes.
For example 4 4 4字节的 i n t int int只会从 4 4 4's multiple starts to exist, exists 4 4 The storage method of 4 bytes will occupy an alignment block.
This picture can illustrate this problem very well.
Regarding offset, it refers to the address distance of the current variable 0 0 0Geographical distance.