mirror of
https://github.com/servo/servo.git
synced 2025-08-16 02:45:36 +01:00
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>
This commit is contained in:
parent
e9f364ef51
commit
ba8f923201
19 changed files with 135 additions and 49 deletions
|
@ -5,14 +5,13 @@
|
|||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
|
||||
use app_units::Au;
|
||||
use euclid::num::Zero;
|
||||
use fonts::platform::font::PlatformFont;
|
||||
use fonts::{
|
||||
Font, FontData, FontDescriptor, FontIdentifier, FontTemplate, PlatformFontMethods,
|
||||
ShapingFlags, ShapingOptions,
|
||||
Font, FontData, FontDescriptor, FontIdentifier, FontTemplate, FontTemplateRef,
|
||||
PlatformFontMethods, ShapingFlags, ShapingOptions,
|
||||
};
|
||||
use servo_url::ServoUrl;
|
||||
use style::properties::longhands::font_variant_caps::computed_value::T as FontVariantCaps;
|
||||
|
@ -42,13 +41,7 @@ fn make_font(path: PathBuf) -> Font {
|
|||
variant: FontVariantCaps::Normal,
|
||||
pt_size: Au::from_px(24),
|
||||
};
|
||||
Font::new(
|
||||
Arc::new(atomic_refcell::AtomicRefCell::new(template)),
|
||||
descriptor,
|
||||
Some(data),
|
||||
None,
|
||||
)
|
||||
.unwrap()
|
||||
Font::new(FontTemplateRef::new(template), descriptor, Some(data), None).unwrap()
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -137,6 +137,7 @@ mod font_context {
|
|||
break;
|
||||
},
|
||||
SystemFontServiceMessage::Ping => {},
|
||||
SystemFontServiceMessage::CollectMemoryReport(..) => {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue