3 ms·
Misaligned accesses, in general, without any qualification, can earn you a SIGSEGV or SIGBUS. It's mostly x86 that's being very tolerant here; other architectu
by eqvinox 7y ago
Misaligned accesses, in general, without any qualification, can earn you a SIGSEGV or SIGBUS. It's mostly x86 that's being very tolerant here; other architectures are much less forgiving to varying degrees.
That's also why this rule is in the C standard to begin with. Misaligned accesses need different / multiple instructions on some of these architectures, making them significantly more expensive. So the decision was made in favor of assuming things are aligned.
- loeg 7y agoAll (or almost all) of the big architectures that have survived to this day and attempt to compete with x86 permit misaligned accesses in general purpose memory. It's true that if you threw a dart at a historical computer architecture, they would likely not be tolerated. But e.g., aarch64 tolerates misaligned access.