-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
std: add pointer stability locks to array list #19676
base: master
Are you sure you want to change the base?
std: add pointer stability locks to array list #19676
Conversation
Co-authored-by: Andrew Kelley <[email protected]>
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.
clone
shouldn't require pointers to be unlocked, right? The only allocations are for the newly cloned ArrayList, and the original allocation is unchanged.
@vortexofdoom Do we consider async here? if we do, then if I try to |
And I was thinking if |
Interesting point. I guess my gut instinct would be to avoid making things that should be trivially possible in non-async settings impossible for the sake of async. In an async setting you can manually lock it before a clone. Appending, even assuming capacity, could "invalidate" a pointer to the last element or similar, so that seems maybe less objectionable, but I could see the argument for removing it. Although I guess the argument exists that you won't be locking much in a non-async context, so it may be a non-issue. |
I see the point for removing assertion from clone. And actually I do support it. It's easy to bring it back in case Anyway, the question about |
Looking at it, I think The buck has to stop somewhere, and I think it's fine to stop short of functions with |
Closes #19326