programming

Pointer alignment to memory

programming
c-programming, pointer alignment

Pointer alignment to memory # Why do you need to alignment at all? # In terms of memory accesses, there are two types of CPUs - ones that support unaligned memory access and others which don’t. On most architectures, memory accesses(load/store instructions) support different byte sizes 1 byte, 2 byte, 4 byte, 8 byte, 16 byte etc. Unaligned memory access is a load/store that is trying to access an address location which is not aligned to the access size. ...