-
Notifications
You must be signed in to change notification settings - Fork 9
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
Explicitly mention in the docs that grow
, grow_zeroed
, and shrink
have to handle changes in alignment
#97
Comments
Sounds good, would you be willing to make a PR to rust-lang/rust to update the documentation? |
Sure! I can probably do that a few hours from now. |
I've opened rust-lang/rust#95546. |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Apr 1, 2022
…n-docs, r=Amanieu add notes about alignment-altering reallocations to Allocator docs As I said in rust-lang/wg-allocators#97, the fact that calls to `grow`, `grow_zeroed`, and `shrink` may request altered alignments is surprising and may be a pitfall for implementors of `Allocator` if it's left implicit. This pull request adds a note to the "Safety" section of each function's docs making it explicit.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Apr 1, 2022
…n-docs, r=Amanieu add notes about alignment-altering reallocations to Allocator docs As I said in rust-lang/wg-allocators#97, the fact that calls to `grow`, `grow_zeroed`, and `shrink` may request altered alignments is surprising and may be a pitfall for implementors of `Allocator` if it's left implicit. This pull request adds a note to the "Safety" section of each function's docs making it explicit.
rust-lang/rust#95546 was merged! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The docs currently imply that the alignment of
new_layout
may be different from that ofold_layout
by not stating otherwise. Reallocations with altered alignments are extremely uncommon; I had to track down #5 in this repository to convince myself this wasn't a mistake. This could be a pitfall for implementors ofAllocator
if it's not made more explicit.The text was updated successfully, but these errors were encountered: