-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
doc: improve documentation of packed type layout modifier #318
base: master
Are you sure you want to change the base?
Conversation
ebdd236
to
20d86cd
Compare
I updated the PR @ehuss . See the latest version here: https://github.com/rust-lang/nomicon/blob/20d86cd0331e1c54bfd85e25326e3e0e41fc979e/src/other-reprs.md Any more comments? |
c28f75e
to
305ffdc
Compare
Sorry for the circumstances on this, I obviously understood something wrong. I tried to improve the description in a way, |
305ffdc
to
ae11a44
Compare
ae11a44
to
93760d4
Compare
side-effects. | ||
|
||
In particular, most architectures *strongly* prefer values to be aligned. This | ||
may mean the unaligned loads are penalized (x86), or even fault (some ARM | ||
chips). For simple cases like directly loading or storing a packed field, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can remove this from the PR if you want. This was necessary so that each paragraph has roughly the same width in the markdown file.
93760d4
to
fbb0bab
Compare
@ehuss I rebased the PR branch onto the latest master branch. |
fbb0bab
to
eab859a
Compare
This commit improves the description of the packed type layout modifier.
eab859a
to
c17dd17
Compare
The Rust language reference (and my experience, proved by tests) says, thatpacked(n)
gives you the ability to align the struct too. This bug probably comes from a past version of Rust, where this wasn't supported.Currently, the packed documentation doesn't mention the n-parameter.
https://doc.rust-lang.org/reference/type-layout.html