Skip to content

base: Implement MallocSizeOf for some more types#43858

Merged
TimvdLippe merged 1 commit into
servo:mainfrom
Narfinger:malloc-sizeof
Apr 2, 2026
Merged

base: Implement MallocSizeOf for some more types#43858
TimvdLippe merged 1 commit into
servo:mainfrom
Narfinger:malloc-sizeof

Conversation

@Narfinger
Copy link
Copy Markdown
Contributor

@Narfinger Narfinger commented Apr 2, 2026

This implements MallocSizeOf for a couple more types and removes some "ignore_malloc_size_of" throughout the codebase.

  • std::path::PathBuf
  • tokio::sync::oneshot::Sender
  • http::HeaderMap (with a reasonable approximation of iterating over all headers)
  • data_url::Mime by looking at the inner type
  • http::Method: Is an enum internally
  • urlpattern::Urlpattern: Iterating over all public fields that are strings as an approximation.

Testing: We cannot test if MallocSizeOf is correct currently.

@Narfinger Narfinger marked this pull request as ready for review April 2, 2026 07:17
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 2, 2026
@Narfinger Narfinger changed the title base: Implement MallocSizeOf for a coudple more types base: Implement MallocSizeOf for some more types Apr 2, 2026
Signed-off-by: Narfinger <[email protected]>
Copy link
Copy Markdown
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 2, 2026
@TimvdLippe TimvdLippe added this pull request to the merge queue Apr 2, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 2, 2026
Merged via the queue into servo:main with commit f7d7775 Apr 2, 2026
34 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 2, 2026
@Narfinger Narfinger deleted the malloc-sizeof branch April 2, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants