fonts: Measure more FontContext heap usage. (#38733)

Replace a hand-written MallocSizeOf implementation with an automatically
derived one. This exposes more than 1MB of previously-untracked heap
data on servo.org.

Testing: Compared about:memory output for servo.org before and after.
Part of: #11559

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-08-17 14:59:30 -04:00 committed by GitHub
parent d490c5c06b
commit 9da8142e2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 59 additions and 32 deletions

View file

@ -363,7 +363,7 @@ struct FontTemplateCacheKey {
/// The public interface to the [`SystemFontService`], used by per-Document
/// `FontContext` instances.
#[derive(Debug)]
#[derive(Debug, MallocSizeOf)]
pub struct SystemFontServiceProxy {
sender: Mutex<IpcSender<SystemFontServiceMessage>>,
templates: RwLock<HashMap<FontTemplateCacheKey, Vec<FontTemplateRef>>>,