-
Notifications
You must be signed in to change notification settings - Fork 84
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
get_unchecked
isn't unchecked
#74
Open
digama0
wants to merge
7
commits into
tokio-rs:master
Choose a base branch
from
digama0:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Commits on Jan 16, 2021
-
This can be seen in the assembly generated by the `get_unchecked` function. Although there is no bounds checking on the array, it still checks whether the entry is occupied and so there is a branch and panic handling code due to the use of `unreachable!()`. I think that logically, both kinds of checking are the same type of error (you accessed an invalid index), so it makes sense for `get_unchecked` to do no branches at all, only address arithmetic. The only open question is whether the documentation should be adjusted to use a term other than "bounds checking" here since the set of valid slab indices is not an interval.
Configuration menu - View commit details
-
Copy full SHA for 2773b53 - Browse repository at this point
Copy the full SHA 2773b53View commit details
Commits on Jan 30, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 851fbcb - Browse repository at this point
Copy the full SHA 851fbcbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 85d7d45 - Browse repository at this point
Copy the full SHA 85d7d45View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d02216 - Browse repository at this point
Copy the full SHA 8d02216View commit details -
Configuration menu - View commit details
-
Copy full SHA for a3b40c4 - Browse repository at this point
Copy the full SHA a3b40c4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1c4839b - Browse repository at this point
Copy the full SHA 1c4839bView commit details
Commits on Jan 31, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 44c276e - Browse repository at this point
Copy the full SHA 44c276eView commit details
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.