-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Rewriting native hashed collection indices (rebased) #5291
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
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
76c6281
[stdlib] Rewriting native hashed collection indices
b08732c
[stdlib] Update Dictionary comments to reflect new design
953e51a
[stdlib] Handle some outstanding Dictionary indexing-model FIXMEs/TODOs
e8f4cb6
update reflection tests with new type layouts for Dictionary
b7e200e
properly expose == to objc in test
d179655
refactor Dictionary to support an empty singleton
052e94a
refactor HashedCollections to support verbatim bridging
f12d791
update comments in HashedCollections to reflect new design
a43c1df
Some minor cleanups in HashedCollections:
3144870
add new toll-free bridge fast-paths to HashedCollections
41fb15f
rename Buffer <---> Storage in HashedCollections to match conventions
b1425ce
remove _'s from some variables that don't need it
8eea522
rename storage type to be more useful
7ec26fc
fallout of renaming on tests which rely on internals
8b44a07
remove nonsensical identity tests from test suite
bb0b4be
Update comment to clarify why it's interesting, link a relevant impl.
731aa14
Properly if-def out bridging code.
b4d9777
more comment cleanups
a62f6c6
Fix incorrect bitcasts, refactor code to guard against this error.
428cdac
leave FIXME for future dictionary bucaneers
5e776e5
cleanup initializers in HashedCollections
931f7ba
actually used the cached keys/values pointer
3cdc8ec
remove buffer header to eliminate optional traps
e4c5e15
remove useless constant redefinition
Gankra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2,345 changes: 1,208 additions & 1,137 deletions
2,345
stdlib/public/core/HashedCollections.swift.gyb
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
Oops, something went wrong.
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.
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.
This looks like it might be changing what we're testing, since the default for classes (and thus, presumably, id-as-Any boxes) is to compare by object identity.
In any case, the commit message (at least) should describe what practical effect this change has. Was the test checking the wrong thing?
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.
Yeah I determined the test wanted to check for value-equality, and not object-equality. It's literally the only way this assertion makes sense: https://github.com/apple/swift/blob/master/test/stdlib/TestUserInfo.swift#L105
Unless the test really intended to rely on the pointer-stability-even-from-different-bridgings fact, in which case it's just testing for something we no longer guarantee.
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.
OK. Just please try to spell that kind of thing out in commit messages and/or comments