Move capacity overflow panic to own cold function #63
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.
This removes a couple instructions from
ThinVec::push
and probably other methods as previously eachexpect
was getting it's own jump tocall expect_failed
whereas with this they can all simply jump to callcapacity_overflow
. This also leads to the inlining ofheader_with_capacity
intoThinVec::push
, which was previously an outlined call.I can't find any benchmarks in the repo to test against, but the increased inlining with a smaller method sounds like a good thing.