-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Clean up AllocRef implementation and documentation #75657
Conversation
// SAFETY: the caller must ensure that the `new_size` does not overflow. | ||
// `layout.align()` comes from a `Layout` and is thus guaranteed to be valid for a Layout. | ||
// The caller must ensure that `new_size` is greater than or equal to zero. If it's equal | ||
// to zero, it's catched beforehand. |
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.
new_size
is always greater than or equal to zero, it's unsigned. Also, it was neither checked, if it's zero before, nor it is required, as self.alloc
is well defined for zero-sized layouts. Thus I removed the second part.
@bors r+ |
📌 Commit 63d241a has been approved by |
Do you think this is likely to have a perf impact? Let me know so I can set rollup=never. |
Hmm, I don't think so, but you can rollup=never just to be sure. If there is one, it shouldn't be more than 0.1% at most. |
@bors rollup=never |
☀️ Test successful - checks-actions, checks-azure |
r? @Amanieu