All static data (variables and typed constants) which are greater than a byte are usually aligned on
a power of two boundary. This alignment applies only to the start address of the variables, and not the
alignment of fields within structures or objects for example. For more information on structured
alignment, section 8.3, page 369. The alignment is similar across the different target processors.
2
Table 8.8: | Data alignment |
|
|
|
| Data size (bytes) | Alignment (small size) | Alignment (fast) |
1 | 1 | 1 |
2-3 | 2 | 2 |
4-7 | 2 | 4 |
8+ | 2 | 4 |
|
|
|
| |
|
The alignment columns indicates the address alignment of the variable, i.e the start address of the
variable will be aligned on that boundary. The small size alignment is valid when the code
generated should be optimized for size (-Og compiler option) and not speed, otherwise and by
default, the fast alignment is used to align the data.