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

Clean up AllocRef implementation and documentation #75657

Merged
merged 3 commits into from
Aug 18, 2020

Conversation

TimDiekmann
Copy link
Member

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 18, 2020
// 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.
Copy link
Member Author

@TimDiekmann TimDiekmann Aug 18, 2020

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.

@Amanieu
Copy link
Member

Amanieu commented Aug 18, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Aug 18, 2020

📌 Commit 63d241a has been approved by Amanieu

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 18, 2020
@Amanieu
Copy link
Member

Amanieu commented Aug 18, 2020

Do you think this is likely to have a perf impact? Let me know so I can set rollup=never.

@TimDiekmann
Copy link
Member Author

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.

@Amanieu
Copy link
Member

Amanieu commented Aug 18, 2020

@bors rollup=never

@bors
Copy link
Contributor

bors commented Aug 18, 2020

⌛ Testing commit 63d241a with merge be97d13...

@bors
Copy link
Contributor

bors commented Aug 18, 2020

☀️ Test successful - checks-actions, checks-azure
Approved by: Amanieu
Pushing be97d13 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 18, 2020
@bors bors merged commit be97d13 into rust-lang:master Aug 18, 2020
@TimDiekmann TimDiekmann deleted the allocref-cleanup branch August 18, 2020 20:51
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants