Skip to content

Commit 853a66d

Browse files
committed
explicitly mention padding due to alignment
1 parent f790829 commit 853a66d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/langref.html.in

+3-2
Original file line numberDiff line numberDiff line change
@@ -2182,11 +2182,12 @@ or
21822182
<ul>
21832183
<li>Fields are arranged in the order declared, from the least to the most significant bits of a backing integer.</li>
21842184
<li>There is no padding between fields.</li>
2185+
<li>The backing integer has the same bit width as the fields' total bit width.</li>
21852186
<li>The backing integer is subject to the same rules as any integer, including {#link|alignment|Alignment#},
21862187
having a maximum bit count of 65535, and the host endianness.
2187-
On a big endian system, the first declared field will have the highest memory address.
2188+
On a big endian system, the first declared field will have the highest memory address, and on a little endian system, the lowest.
21882189
</li>
2189-
<li>The backing integer has the same bit width as the fields' total bit width.</li>
2190+
<li>Due to {#link|alignment|Alignment#}, the backing integer may require more memory that its bit width. {#link|@bitSizeOf|@bitSizeOf#} and {#link|@sizeOf|@sizeOf#} can interrogate the difference.</li>
21902191
<li>Field access and assignment can be understood as shorthand for bitshifts on the backing integer.</li>
21912192
<li>An {#link|integer|Integers#} field uses exactly as many bits as its bit width. For example, a {#syntax#}u5{#endsyntax#} will use 5 bits of the backing integer.</li>
21922193
<li>A {#link|bool|Primitive Types#} field uses exactly 1 bit.</li>

0 commit comments

Comments
 (0)