-
-
Notifications
You must be signed in to change notification settings - Fork 551
feat(allocator): remove drop operations from Vec2 #9679
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
feat(allocator): remove drop operations from Vec2 #9679
Conversation
CodSpeed Performance ReportMerging #9679 will not alter performanceComparing Summary
|
580a508
to
bd3dede
Compare
e7aa3de
to
c20bc2e
Compare
9cd5c00
to
408ac4e
Compare
c20bc2e
to
5351a48
Compare
I am not sure which |
5351a48
to
d7ed2b3
Compare
408ac4e
to
c42ddc7
Compare
d7ed2b3
to
c0e0d41
Compare
c42ddc7
to
abeeffb
Compare
c0e0d41
to
cf32c65
Compare
abeeffb
to
1e132d3
Compare
1e132d3
to
ea60f86
Compare
cf32c65
to
0727727
Compare
6545eb1
to
0454799
Compare
ea60f86
to
c41251f
Compare
We can remove loads. But I'd suggest starting by just removing:
That'd bring Removing further But we may want to simplify/remove other code first. |
0454799
to
958af20
Compare
c41251f
to
eca5456
Compare
eca5456
to
b3558da
Compare
958af20
to
328e5d0
Compare
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.
Could we limit the scope of this PR to just removing these 2?
impl<'bump, T> Drop for Vec<'bump, T>
impl<'a, T> Drop for RawVec<'a, T>
Those 2 Drop
impls are definitely fine to remove. The other ones are less clear without reading all the code around them.
I think it's preferable to go step-by-step on this. It'd be very easy to make a mistake somewhere and cause UB, so I think it's better to err on the side of caution.
This PR is already just removing these 2 which you suggested, additionally, removed |
328e5d0
to
5cc614a
Compare
b3558da
to
a202e87
Compare
a202e87
to
fbba78c
Compare
fbba78c
to
32f8347
Compare
OK. I was being lazy. I didn't want to check what I have checked now - But could you replace them with comments saying something like this? // Don't need `mem::forget(self)` here, because `Vec` does not implement `Drop` |
32f8347
to
dda7025
Compare
Done! |
Merge activity
|
dda7025
to
65643bc
Compare
self.reserve(1)
calls with self.grow_one()
for better efficiency
#9856
Just like #6623. Since we have control over the
Vec
implementation, we can remove thedrop
operations and eventually revert the changes made in #6623 directly.