mirror of
https://github.com/servo/servo.git
synced 2025-09-27 15:20:09 +01:00
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:
parent
d490c5c06b
commit
9da8142e2a
8 changed files with 59 additions and 32 deletions
|
@ -23,6 +23,7 @@ ipc-channel = { workspace = true }
|
|||
keyboard-types = { workspace = true }
|
||||
markup5ever = { workspace = true }
|
||||
mime = { workspace = true }
|
||||
parking_lot = { workspace = true }
|
||||
resvg = { workspace = true }
|
||||
servo_allocator = { path = "../allocator" }
|
||||
servo_arc = { workspace = true }
|
||||
|
|
|
@ -613,6 +613,18 @@ impl<T: MallocSizeOf> MallocSizeOf for std::sync::Mutex<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: MallocSizeOf> MallocSizeOf for parking_lot::Mutex<T> {
|
||||
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
(*self.lock()).size_of(ops)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: MallocSizeOf> MallocSizeOf for parking_lot::RwLock<T> {
|
||||
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
(*self.read()).size_of(ops)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: MallocSizeOf, Unit> MallocSizeOf for euclid::Length<T, Unit> {
|
||||
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||
self.0.size_of(ops)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue