-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add note about pointer state after the call. #23561
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Some reallocations can succeed in-place I believe, so in that sense this may not be 100% true because the same pointer could be returned. Perhaps something like:
|
@alexcrichton fixed, i just re-ordered the sentence |
@@ -26,6 +26,10 @@ pub unsafe fn allocate(size: usize, align: usize) -> *mut u8 { | |||
/// | |||
/// On failure, return a null pointer and leave the original allocation intact. | |||
/// | |||
/// If the allocation was relocated, the memory at the passed-in pointer is undefined after the | |||
/// call. | |||
/// |
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.
stray double newline, I'd also tend to preserve the surrounding style by wrapping to 80 chars as well. Other than that though r=me
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.
Our vim files auto-wrap at 100, so doing this is a manual thing, which kinda sucks. I'll still do it here, this just keeps cropping up.
@bors: r=alexcrichton rollup |
📌 Commit 2750e3c has been approved by |
- Successful merges: rust-lang#22954, rust-lang#23119, rust-lang#23509, rust-lang#23561, rust-lang#23590, rust-lang#23607, rust-lang#23608, rust-lang#23618, rust-lang#23622, rust-lang#23639, rust-lang#23641 - Failed merges: rust-lang#23401
Fixes #23422