-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Remove RawVec::reserve_in_place
.
#72417
Remove RawVec::reserve_in_place
.
#72417
Conversation
I recommend reviewing the commits one at a time. This shouldn't affect perf, but I've seen small changes to |
Awaiting bors try build completion |
⌛ Trying commit c6ac55dcbb3bc9a462147f4bd3530987b93c23fa with merge ce50223feb6be16fc4e3597602fb0326a1e89e3a... |
c6ac55d
to
6d514d1
Compare
@bors try |
⌛ Trying commit 6d514d1fe16b04ec3264c7bd3e396dda4d3c9bdd with merge 8d66106238885e2ad4a8da3600a2dd845483f66f... |
☀️ Try build successful - checks-azure |
Queued 8d66106238885e2ad4a8da3600a2dd845483f66f with parent 963bf52, future comparison URL. |
Finished benchmarking try commit 8d66106238885e2ad4a8da3600a2dd845483f66f, comparison URL. |
Perf results show a very slight win. |
@Amanieu: with Perhaps |
|
Oh nevermind, I see you just removes those uses. |
cc @TimDiekmann |
I don't like the idea to remove the feature to grow/shrink in-place from If the API is not going to be added to |
Blocked on rust-lang/wg-allocators#58 |
It's not blocked... this PR removes a use of |
Oh right, good point. @bors r+ |
📌 Commit 6d514d1fe16b04ec3264c7bd3e396dda4d3c9bdd has been approved by |
…ace, r=Amanieu Remove `RawVec::reserve_in_place`. And some related clean-ups. r? @oli-obk
This will break rls and rustfmt builds so @bors r- while we're on the beta week.
|
☔ The latest upstream changes (presumably #72927) made this pull request unmergeable. Please resolve the merge conflicts. |
This causes unnecessary calls to `grow` when the allocation would fit exactly in the remaining space.
They are pointless. No reasonable allocator will be able to satisfy a `reserve_in_place` request that *doubles* the size of an allocation when dealing with allocations that are 4 KiB and larger. Just to be sure, I confirmed on Linux that the `reserve_in_place` calls never succeed. (Note however that the `reserve_in_place` call for `DroplessArena::grow` did occasionally succeed prior to the off-by-one fix in the previous commit, because we would sometimes do a `reserve_in_place` request for the chunk's current size, which would trivially succeed!)
Also remove a now-unnecessary `placement` argument.
- Use `len` more consistently for the number of elements in a vector, because that's the usual name. - Use `additional` more consistently for the number of elements we want to add, because that's what `Vec::reserve()` uses. - Use `cap` consistently rather than `capacity`. - Plus a few other tweaks. This increases consistency and conciseness.
2391497
to
c9cbe7e
Compare
I have rebased and beta week is over. @bors r=Amanieu |
📌 Commit c9cbe7e has been approved by |
⌛ Testing commit c9cbe7e with merge f8ed3f6c733f2119bda67b3cb01575c03005453b... |
…ace, r=Amanieu Remove `RawVec::reserve_in_place`. And some related clean-ups. r? @oli-obk
@bors retry (this pr is included in the rollup) |
Rollup of 8 pull requests Successful merges: - rust-lang#72417 (Remove `RawVec::reserve_in_place`.) - rust-lang#73098 (Add Item::is_fake for rustdoc) - rust-lang#73122 (Resolve E0584 conflict) - rust-lang#73123 (Clean up E0647 explanation) - rust-lang#73133 (Enforce unwind invariants) - rust-lang#73148 (Fix a typo (size of the size)) - rust-lang#73149 (typo: awailable -> available) - rust-lang#73161 (Add mailmap entry) Failed merges: r? @ghost
And some related clean-ups.
r? @oli-obk