buffer: annotate Slice::SizedStorage with counted_by - #47442
Open
LaptopsPlural wants to merge 1 commit into
Open
LaptopsPlural wants to merge 1 commit into
LaptopsPlural wants to merge 1 commit into
Conversation
|
Hi @LaptopsPlural, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
LaptopsPlural
had a problem deploying
to
external-contributors
September 14, 2026 14:42 — with
GitHub Actions
Error
SizedStorage is the true alloc-capacity pair (mem_, len_) for Slice backend storage. Represent mem_ as a raw uint8_t* so Clang's counted_by can describe the bound, with RAII and release() into StoragePtr at Slice/free-list boundaries. The attribute is guarded by __has_attribute and is a no-op on unsupported compilers. Signed-off-by: Jeff Bindel <jeff@incrediblybased.co>
LaptopsPlural
force-pushed
the
buffer-sizedstorage-counted-by
branch
from
September 14, 2026 14:55
aed17b2 to
1cef9c9
Compare
LaptopsPlural
requested a deployment
to
external-contributors
September 14, 2026 14:55 — with
GitHub Actions
Waiting
Contributor
|
/assign-from envoyproxy/senior-maintainers |
|
envoyproxy/senior-maintainers assignee is @phlax |
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
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.
Description
Slice::SizedStorageis the true alloc-capacity pair for Slice backend storage (mem_points atlen_bytes). This change:mem_asuint8_t*so Clang’scounted_bycan describe the bound (the attribute applies to raw pointers, notstd::unique_ptr).StoragePtrviarelease()at Slice construction and free-list boundaries.__has_attribute(__counted_by__), so default builds are unchanged on compilers without support.Does not modify
Buffer::Slicecursor fields (base_/data_/reservable_/capacity_),ListenerFilterBufferImpl, or the publicRawSliceABI.AI assistance
This change was authored with AI assistance. I own the design and the diff, understand the ownership/
counted_bytradeoff, and will address review feedback.Testing
SizedStoragevia reserve/commit paths.counted_bysupport.