mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00: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
|
@ -8,6 +8,7 @@ use base::id::PipelineId;
|
|||
use compositing_traits::CrossProcessCompositorApi;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use log::debug;
|
||||
use malloc_size_of::MallocSizeOfOps;
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
use pixels::{Image, ImageMetadata};
|
||||
use profile_traits::mem::Report;
|
||||
|
@ -116,7 +117,7 @@ pub trait ImageCache: Sync + Send {
|
|||
where
|
||||
Self: Sized;
|
||||
|
||||
fn memory_report(&self, prefix: &str) -> Report;
|
||||
fn memory_report(&self, prefix: &str, ops: &mut MallocSizeOfOps) -> Report;
|
||||
|
||||
/// Definitively check whether there is a cached, fully loaded image available.
|
||||
fn get_image(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue