aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2025-04-17 07:57:04 -0400
committerGitHub <noreply@github.com>2025-04-17 11:57:04 +0000
commit594c04dc7c75a0a1d0d860ea1234cad97c322620 (patch)
tree64dc4844583b5e1e2728408eb788f7ae44f87761
parentd345844ed715fb96286808da8a5fc81f1bb22447 (diff)
downloadservo-594c04dc7c75a0a1d0d860ea1234cad97c322620.tar.gz
servo-594c04dc7c75a0a1d0d860ea1234cad97c322620.zip
Report memory usage for image frames. (#36581)
These changes make the image-cache memory reporter report much larger values after loading image-heavy pages. Testing: Manual testing on https://www.nist.gov/image-gallery Fixes: #36559 Signed-off-by: Josh Matthews <josh@joshmatthews.net>
-rw-r--r--components/malloc_size_of/lib.rs6
-rw-r--r--components/pixels/lib.rs2
2 files changed, 6 insertions, 2 deletions
diff --git a/components/malloc_size_of/lib.rs b/components/malloc_size_of/lib.rs
index f2da13883b9..dbecc0da2c3 100644
--- a/components/malloc_size_of/lib.rs
+++ b/components/malloc_size_of/lib.rs
@@ -688,6 +688,12 @@ impl<T> MallocSizeOf for ipc_channel::ipc::IpcSender<T> {
}
}
+impl MallocSizeOf for ipc_channel::ipc::IpcSharedMemory {
+ fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
+ self.len()
+ }
+}
+
impl<T: MallocSizeOf> MallocSizeOf for accountable_refcell::RefCell<T> {
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
self.borrow().size_of(ops)
diff --git a/components/pixels/lib.rs b/components/pixels/lib.rs
index b327d401262..7cba060ec74 100644
--- a/components/pixels/lib.rs
+++ b/components/pixels/lib.rs
@@ -123,7 +123,6 @@ pub struct Image {
pub width: u32,
pub height: u32,
pub format: PixelFormat,
- #[ignore_malloc_size_of = "Defined in webrender_api"]
pub id: Option<ImageKey>,
pub cors_status: CorsStatus,
pub frames: Vec<ImageFrame>,
@@ -132,7 +131,6 @@ pub struct Image {
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)]
pub struct ImageFrame {
pub delay: Option<Duration>,
- #[ignore_malloc_size_of = "Defined in ipc-channel"]
pub bytes: IpcSharedMemory,
pub width: u32,
pub height: u32,