Non-compliance limits arise only when the load or magazine crosses the leveling line. The border is usually smaller:
- The natural size of the word hardware. (32-bit or 64-bit *)
- The size of the data type.
If you load a 4-byte word in 64-bit (8-byte) architecture. It should not be aligned by 8 bytes. It should be only 4 bytes.
Similarly, if you download a 1-byte char on any machine, it does not need to be aligned at all.
* Please note that SIMD vectors may mean a larger natural word size. For example, a 16-byte SSE still requires 16-byte alignment on both x86 and x64. (prohibition of explicit inconsistent loads / storages)
In short, you do not need to worry about data alignment. The language and the compiler are trying very hard to prevent you from worrying about this.
So just stick to whatever type of data is best for you.
Mysticial
source share