4.33 Relevance of natural data alignment at compile time

Data alignment becomes relevant when the compiler allocates memory locations to variables.

For example, in the following structure, a three-byte gap is required between bmem and cmem.
struct example_st {
  int amem;
  char bmem;
  int cmem;
Related concepts
4.30 Types of data alignment
4.31 Advantages of natural data alignment
4.34 Unaligned data access in C and C++ code
4.35 The __packed qualifier and unaligned data access in C and C++ code
Related reference
4.32 Compiler storage of data objects by natural byte alignment
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.