3 ms·
It's related to the CPU, there's a nice wiki article[0] that goes into it a bit more. Also in [0] it mentions that SSE instructions will only work with 128-bit
by matthewwarren 12y ago
It's related to the CPU, there's a nice wiki article[0] that goes into it a bit more. Also in [0] it mentions that SSE instructions will only work with 128-bit aligned data, so sometimes it's a requirement.
Alignment can make memory access more efficient, but means that data can take up more space.
Packing is the opposite of this, rearranging fields, so that they take up the smallest space possible.
So the 2 things are a trade-off.
[0] http://en.wikipedia.org/wiki/Data_structure_alignment http://en.wikipedia.org/wiki/Data_structure_alignment