Data structure alignment is the way data is arranged and accessed in computer memory. It consists of two separate but related issues: data alignment and data structure padding. When a modern computer reads from or writes to a memory address, it will do this in word sized chunks (e.g. 4 byte chunks on a 32-bit system). Data alignment means putting the data at a memory offset equal to some multiple of the word size, which increases the system's performance due to the way the CPU handles memory. To align the data, it may be necessary to insert some meaningless bytes between the end of the last data structure and the start of the next, which is data structure padding.
数据结构对齐数据的安排和在计算机的内存访问方式。 它由两个单独但相关的问题: 数据对齐和数据结构填充 。 当现代计算机读取或写入到一个内存地址,它会在这个词 (例如4字节的块,在32位系统)大小的块,数据对齐意味着将在内存中的数据等于多个部分抵消字的大小,从而提高系统的性能由于CPU处理内存的方式。 要对齐的数据,它可能需要一些毫无意义的字节之间插入的最后一个数据结构和未来的开始,这是数据结构的填充。
http://news.boxuu.com/news/2010-8-23/79475_16.html