| |||
| Home > Compiler Features > Eight‑byte alignment features | |||
The ARM compiler has the following eight-byte alignment features:
The Procedure Call Standard for the ARM Architecture (AAPCS) requires that the stack is eight-byte aligned at all external interfaces. The ARM compiler and C libraries preserve the eight-byte alignment of the stack. In addition, the default C library memory model maintains eight-byte alignment of the heap.
Code is compiled in a way that requires and preserves the eight byte alignment constraints at external interfaces.
If you have assembly files, or legacy objects, or libraries in your project, it is your responsibility to check that they preserve eight-byte stack alignment, and correct them if required. See the Assembler Guide and the Linker User Guide.
In RVCT v2.0 and later, double and long
long data types are eight-byte aligned. This enables efficient
use of the LDRD and STRD instructions
in ARMv5TE and later.
The default implementations of malloc(), realloc(),
and calloc() maintain an eight-byte aligned
heap.
The default implementation of alloca() returns
an eight-byte aligned block of memory. See alloca() in
the Libraries Guide for more information on
this C library extension.