-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Revert regression of memory unsafe append_array
(same vector into same vector).
#101386
base: master
Are you sure you want to change the base?
Revert regression of memory unsafe append_array
(same vector into same vector).
#101386
Conversation
#31736 was a great issue, I have to commend the author. I've since been guilty of exactly this mistake myself (in Incidentally, for things like append in the long run, it could be worth checking for within the vector to avoid making a copy, because the benefits to doing the "check within" were higher the larger the size of the object being copied. As you say, here, COW might mostly negate this cost luckily. |
append_array
(same vector into same vector).
For the record this was changed in #86966 (CC @Muller-Castro). |
I did it this way because I like to have separate no-op commits (like adding docs) and behavior change commits. But I'm happy to oblige if you'd prefer to have it all in one. Edit: Done! |
… (append vector to itself). Add comments to prevent future regressions.
18607ca
to
cf145de
Compare
Hello! 🤝 should I rollback the |
Follow-up of #101385
This will cause a minor performance regression. But
Vector
is CoW so it won't be noticeable (and probably not even observable).See #31736.