mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -25,7 +25,7 @@ use net_traits::request::{
|
|||
CredentialsMode, Destination, InsecureRequestsPolicy, ParserMetadata,
|
||||
RequestBuilder as NetRequestInit,
|
||||
};
|
||||
use profile_traits::mem::ProcessReports;
|
||||
use profile_traits::mem::{ProcessReports, perform_memory_report};
|
||||
use servo_url::{MutableOrigin, ServoUrl};
|
||||
use timers::TimerScheduler;
|
||||
use uuid::Uuid;
|
||||
|
@ -546,8 +546,10 @@ impl WorkerGlobalScope {
|
|||
CommonScriptMsg::Task(_, task, _, _) => task.run_box(),
|
||||
CommonScriptMsg::CollectReports(reports_chan) => {
|
||||
let cx = self.get_cx();
|
||||
let reports = cx.get_reports(format!("url({})", self.get_url()));
|
||||
reports_chan.send(ProcessReports::new(reports));
|
||||
perform_memory_report(|ops| {
|
||||
let reports = cx.get_reports(format!("url({})", self.get_url()), ops);
|
||||
reports_chan.send(ProcessReports::new(reports));
|
||||
});
|
||||
},
|
||||
}
|
||||
true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue