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
[stdlib] add more debug-mode range checking to UnsafeBufferPointer #13340
Merged
Conversation
This file contains 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
Ping @lorentey |
glessard
force-pushed
the
umbp-failearlyrangecheck
branch
from
December 8, 2017 09:08
1393171
to
93323fe
Compare
@swift-ci Please smoke test |
@swift-ci Please benchmark |
@swift-ci please benchmark OS X platform |
Build comment file:Optimized (O)Regression (2)
Improvement (1)
No Changes (328)
Unoptimized (Onone)Regression (4)
Improvement (8)
No Changes (319)
Hardware Overview
|
glessard
force-pushed
the
umbp-failearlyrangecheck
branch
4 times, most recently
from
December 14, 2017 00:32
3106b15
to
4dc74b3
Compare
@swift-ci Please smoke test |
The benchmarks look just fine! I think this is ready to merge after #12504, so |
glessard
force-pushed
the
umbp-failearlyrangecheck
branch
from
December 15, 2017 23:48
4dc74b3
to
68e50d3
Compare
glessard
changed the title
[stdlib] WIP - add more debug-mode range checking to UnsafeBufferPointer
[stdlib] add more debug-mode range checking to UnsafeBufferPointer
Dec 15, 2017
Cool! I removed the cherry-picked commits from this branch. Thanks for your help |
@swift-ci test and merge |
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.
Adds
_debugPrecondition
calls to_failEarlyRangeCheck
inUnsafe{Mutable}BufferPointer
._failEarlyRangeCheck
inSlice
forwards to its Base. In the case of the UnsafeBufferPointers, that is an empty function. This means that one can use a Slice to get or set to any index of its base BufferPointer, not limited to the indices in the slice'sstartIndex..<endIndex
range. While this is fine in release mode, this is surprising in debug mode, where the UnsafeBufferPointers do perform some range checking.Should be merged after #12504
Resolves SR-6549.