-
-
Notifications
You must be signed in to change notification settings - Fork 553
feat(data_structures): add CodeBuffer::*_unchecked_cap
methods
#10075
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
base: main
Are you sure you want to change the base?
feat(data_structures): add CodeBuffer::*_unchecked_cap
methods
#10075
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
CodSpeed Instrumentation Performance ReportMerging #10075 will not alter performanceComparing Summary
|
b6529c8
to
d53e323
Compare
61beb43
to
5e14fe9
Compare
I wrote these originally to use in #10046, but turns out they're unnecessary there. But these are still useful APIs, so I think worthwhile adding them. |
I'm not keen to add code that's never going to be used though. Do we have scenarios for these 3 methods? |
Add 3 methods to
CodeBuffer
:print_byte_unchecked_cap
print_bytes_unchecked_cap
print_str_unchecked_cap
All 3 are unsafe methods which require caller to ensure there is sufficient capacity in the buffer. This allows minimizing bounds checks when pushing multiple bytes sequences to the buffer.