Data structure alignment: Difference between revisions

Content deleted Content added
Kavuldra (talk | contribs)
Definitions: Address 'a' isn't a multiple of 'n bytes', just a multiple of 'n'.
m Definitions: {{math}}
Line 46:
 
==Definitions==
A memory address ''a'' is said to be ''n-[[byte]] aligned'' when ''a'' is a multiple of ''n'' (where ''n'' is a power of 2). In this context, a byte is the smallest unit of memory access, i.e. each memory address specifies a different byte. An ''n''-byte aligned address would have a minimum of ''{{math|log<sub>2</sub>(''n)'')}} least-significant zeros when expressed in [[binary numeral system|binary]].
 
The alternate wording ''b-bit aligned'' designates a ''b/8&nbsp;byte aligned'' address (ex. [[64-bit]] aligned is 8&nbsp;bytes aligned).