diff options
author | Josh Matthews <josh@joshmatthews.net> | 2025-05-07 00:00:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-07 04:00:12 +0000 |
commit | ba8f9232017266d24f170f371d56a5bc8259bf59 (patch) | |
tree | e1711077285c38a2a40b0fe220c94846072ef5ee /components/layout/layout_impl.rs | |
parent | e9f364ef51b067192c67c9aaab936151fa577ed5 (diff) | |
download | servo-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/layout/layout_impl.rs')
-rw-r--r-- | components/layout/layout_impl.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/components/layout/layout_impl.rs b/components/layout/layout_impl.rs index b8d91c38027..cdf76d3fed0 100644 --- a/components/layout/layout_impl.rs +++ b/components/layout/layout_impl.rs @@ -4,9 +4,8 @@ #![allow(unsafe_code)] -use std::cell::{Cell, LazyCell, RefCell}; -use std::collections::{HashMap, HashSet}; -use std::ffi::c_void; +use std::cell::{Cell, RefCell}; +use std::collections::HashMap; use std::fmt::Debug; use std::process; use std::sync::{Arc, LazyLock}; @@ -95,10 +94,6 @@ use crate::{BoxTree, FragmentTree}; static STYLE_THREAD_POOL: Mutex<&style::global_style_data::STYLE_THREAD_POOL> = Mutex::new(&style::global_style_data::STYLE_THREAD_POOL); -thread_local!(static SEEN_POINTERS: LazyCell<RefCell<HashSet<*const c_void>>> = const { - LazyCell::new(|| RefCell::new(HashSet::new())) -}); - /// A CSS file to style the user agent stylesheet. static USER_AGENT_CSS: &[u8] = include_bytes!("./stylesheets/user-agent.css"); |