4.32 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.29 Types of data alignment
4.30 Advantages of natural data alignment
4.33 Unaligned data access in C and C++ code
4.34 The __packed qualifier and unaligned data access in C and C++ code
Related reference
4.31 Compiler storage of data objects by natural byte alignment
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.