What is aligned memory allocation?
Suppose that you have the structure. struct S { short a; int b; char c, d; }; Without alignment, it would be laid out in memory like this (assuming a 32-bit architecture): 0 1 2 3 4 5 6 7 |a|a|b|b|b|b|c|d| bytes | | | words The problem is that on some CPU architectures, the … Read more