All access to data in memory can be classified into the following
categories:
Natural alignment, for example, on
a word boundary at 0x1004. The ARM compiler normally aligns variables
and pads structures so that these items are accessed efficiently using LDR and STR instructions.
Known but non-natural alignment, for example, a
word at address 0x1001. This type of alignment commonly occurs when
structures are packed to remove unnecessary padding. In C and C++,
the __packed qualifier or the #pragma
pack(n) pragma is used to signify
that a structure is packed.
Unknown alignment, for example, a word at an arbitrary
address. This type of alignment commonly occurs when defining a
pointer that can point to a word at any address. In C and C++, the __packed qualifier
or the #pragma pack(n) pragma
is used to signify that a pointer can access a word on a non-natural
alignment boundary.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.