aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlimageelement.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2025-05-07 00:00:12 -0400
committerGitHub <noreply@github.com>2025-05-07 04:00:12 +0000
commitba8f9232017266d24f170f371d56a5bc8259bf59 (patch)
treee1711077285c38a2a40b0fe220c94846072ef5ee /components/script/dom/htmlimageelement.rs
parente9f364ef51b067192c67c9aaab936151fa577ed5 (diff)
downloadservo-ba8f9232017266d24f170f371d56a5bc8259bf59.tar.gz
servo-ba8f9232017266d24f170f371d56a5bc8259bf59.zip
Various memory measurement improvements (#36834)
The two significant changes here are 1) a commit that frees memory used to perform memory reporting once the reporting is complete, 2) memory reporting for the system font service. There are various other commits that remove `#[ignore_malloc_size_of]` attributes for data that we are now able to measure, but they do not significantly change our measurements when testing servo.org. Testing: Comparing the output of about:memory on servo.org. --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Diffstat (limited to 'components/script/dom/htmlimageelement.rs')
-rw-r--r--components/script/dom/htmlimageelement.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs
index adff445ae1c..e0c8e9ef726 100644
--- a/components/script/dom/htmlimageelement.rs
+++ b/components/script/dom/htmlimageelement.rs
@@ -97,6 +97,7 @@ enum ParseState {
AfterDescriptor,
}
+#[derive(MallocSizeOf)]
pub(crate) struct SourceSet {
image_sources: Vec<ImageSource>,
source_size: SourceSizeList,
@@ -111,13 +112,13 @@ impl SourceSet {
}
}
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq)]
pub struct ImageSource {
pub url: String,
pub descriptor: Descriptor,
}
-#[derive(Clone, Debug, PartialEq)]
+#[derive(Clone, Debug, MallocSizeOf, PartialEq)]
pub struct Descriptor {
pub width: Option<u32>,
pub density: Option<f64>,
@@ -145,7 +146,7 @@ struct ImageRequest {
parsed_url: Option<ServoUrl>,
source_url: Option<USVString>,
blocker: DomRefCell<Option<LoadBlocker>>,
- #[ignore_malloc_size_of = "Arc"]
+ #[conditional_malloc_size_of]
#[no_trace]
image: Option<Arc<Image>>,
#[no_trace]
@@ -162,7 +163,6 @@ pub(crate) struct HTMLImageElement {
pending_request: DomRefCell<ImageRequest>,
form_owner: MutNullableDom<HTMLFormElement>,
generation: Cell<u32>,
- #[ignore_malloc_size_of = "SourceSet"]
source_set: DomRefCell<SourceSet>,
last_selected_source: DomRefCell<Option<USVString>>,
#[ignore_malloc_size_of = "promises are hard"]