Repository navigation
Use MallocShallowSizeOf for Brotli stream state - #48220
Merged
Merged
Conversation
Signed-off-by: Taym Haddadi <[email protected]>
gterzian
reviewed
Sep 21, 2026
| match self { | ||
| #[cfg(feature = "brotli-compression-stream")] | ||
| Encoder::Brotli(encoder) => unsafe { ops.malloc_size_of(&**encoder) }, | ||
| Encoder::Brotli(encoder) => encoder.shallow_size_of(ops), |
Member
There was a problem hiding this comment.
Can you not use
servo/components/malloc_size_of/lib.rs
Line 358 in d5dc116
encoder.get_ref().size_of() or something similar?
Member
There was a problem hiding this comment.
Ah no nevermind, I see that now you are doing
servo/components/malloc_size_of/lib.rs
Line 352 in d5dc116
gterzian
approved these changes
Sep 21, 2026
| match self { | ||
| #[cfg(feature = "brotli-compression-stream")] | ||
| Encoder::Brotli(encoder) => unsafe { ops.malloc_size_of(&**encoder) }, | ||
| Encoder::Brotli(encoder) => encoder.shallow_size_of(ops), |
Member
There was a problem hiding this comment.
Ah no nevermind, I see that now you are doing
servo/components/malloc_size_of/lib.rs
Line 352 in d5dc116
RichardTjokroutomo
pushed a commit
to RichardTjokroutomo/servo
that referenced
this pull request
Oct 6, 2026
Use MallocShallowSizeOf to measure boxxed Brotli state in CompressionStream and DecompressionStream to avoid unsafe call. Testing: No new tests are required because Box<T>::shallow_size_of performs the identical allocator measurement Fixes: Part of servo#30862 Signed-off-by: Taym Haddadi <[email protected]>
hhhwsqhhh
pushed a commit
to hhhwsqhhh/servo
that referenced
this pull request
Oct 12, 2026
Use MallocShallowSizeOf to measure boxxed Brotli state in CompressionStream and DecompressionStream to avoid unsafe call. Testing: No new tests are required because Box<T>::shallow_size_of performs the identical allocator measurement Fixes: Part of servo#30862 Signed-off-by: Taym Haddadi <[email protected]>
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.
Use MallocShallowSizeOf to measure boxxed Brotli state in CompressionStream and DecompressionStream to avoid unsafe call.
Testing: No new tests are required because Box::shallow_size_of performs the identical allocator measurement
Fixes: Part of #30862