mirror of
https://github.com/servo/servo.git
synced 2025-07-25 08:10:21 +01:00
Refactor common infrastructure for creating memory reports. (#36579)
This removes a bunch of duplicated code needed to support ConditionalMallocSizeOf correctly, and fixes multiple places where that code was subtly wrong (the seen pointers hashset was never cleared). Testing: Measuring https://www.nist.gov/image-gallery lots of times. Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
2a81987590
commit
5e2d42e944
11 changed files with 68 additions and 57 deletions
|
@ -27,6 +27,7 @@ use fonts::{FontContext, SystemFontServiceProxy};
|
|||
use fxhash::FxHashMap;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use libc::c_void;
|
||||
use malloc_size_of::MallocSizeOfOps;
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use net_traits::image_cache::{ImageCache, PendingImageId};
|
||||
use pixels::Image;
|
||||
|
@ -217,7 +218,7 @@ pub trait Layout {
|
|||
|
||||
/// Requests that layout measure its memory usage. The resulting reports are sent back
|
||||
/// via the supplied channel.
|
||||
fn collect_reports(&self, reports: &mut Vec<Report>);
|
||||
fn collect_reports(&self, reports: &mut Vec<Report>, ops: &mut MallocSizeOfOps);
|
||||
|
||||
/// Sets quirks mode for the document, causing the quirks mode stylesheet to be used.
|
||||
fn set_quirks_mode(&mut self, quirks_mode: QuirksMode);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue