Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec: Improve Definition of Type Layout #1654

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Put an anchor for reprc-unions
chorman0773 committed Oct 17, 2024
commit cd8bf7b0cb4dc02975a69d59062f267ce6879dea
1 change: 1 addition & 0 deletions src/type-layout.md
Original file line number Diff line number Diff line change
@@ -324,6 +324,7 @@ An aggregate type (`struct` or `union`) with the `C` representation is laid out
r[layout.repr.c.align]
An aggregate type with the `C` representation has an alignment equal to the maximum alignment of each of its fields, unless an [alignment modifier][layout.repr.alignment] is present.

<a id="reprc-unions"></a>
> [!NOTE]
> The layout of unions in particular is maximally compact - the size of a `C` representation `union` is the size of its largest field, rounded up to the alignment of the `union`