-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Fix a data race with _swiftEmptyArrayStorage's count #14778
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
Merged
lancep
merged 1 commit into
swiftlang:master
from
lancep:fighting_over_global_array_buffer_count
Feb 22, 2018
Merged
[stdlib] Fix a data race with _swiftEmptyArrayStorage's count #14778
lancep
merged 1 commit into
swiftlang:master
from
lancep:fighting_over_global_array_buffer_count
Feb 22, 2018
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci please test |
@swift-ci please smoke benchmark |
Build comment file:Optimized (O)Regression (4)
Improvement (7)
No Changes (367)
Unoptimized (Onone)Regression (5)
Improvement (5)
No Changes (368)
Hardware Overview
|
moiseev
reviewed
Feb 22, 2018
newResult.firstElementAddress.moveInitialize( | ||
from: result.firstElementAddress, count: result.capacity) | ||
result.count = 0 | ||
if !result.isEmpty { |
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.
The change looks fine, I'm just probably overthinking the weird ways this condition gets to basically saying result.count != 0
, and it's effects on performance and clarity of what's going on =)
moiseev
approved these changes
Feb 22, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dave's analysis in the bug below:
This new zero is getting written over the existing zero after we’ve moved all zero of the zero elements in the empty array buffer into the new buffer, so they won’t be destroyed twice (* zero == zero) . We should just skip this whole part if the source buffer is empty.
rdar://problem/31378400