Unaligned memory accesses is undefined behavior according to the standard. Some architectures support aligned and unaligned memory accesses via the same instructions (i.e. x86, AArch64) while some do not (i.e. RISC-V, PowerPC). Compilers are free to assume that all memory accesses of a type T are done at a suitably aligned address for type T, that is an address aligned to alignof(T). This is not always the case, as there are use cases where we want to access type T at a non-suitably aligned address. This enhancement aims to start addressing this issue by introducing an interface for unaligned memory access that uses a well defined approach.
- links to
-
Review openjdk/jdk/12078