зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1607697 - Box the memory reports in enums. r=Gankro
Clippy warns against it being much larger than the other enum variants. Differential Revision: https://phabricator.services.mozilla.com/D59117 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
dae942943d
Коммит
7a338ae4f3
|
@ -144,7 +144,7 @@ pub enum SceneBuilderRequest {
|
|||
SimulateLongSceneBuild(u32),
|
||||
SimulateLongLowPrioritySceneBuild(u32),
|
||||
Stop,
|
||||
ReportMemory(MemoryReport, MsgSender<MemoryReport>),
|
||||
ReportMemory(Box<MemoryReport>, MsgSender<Box<MemoryReport>>),
|
||||
#[cfg(feature = "capture")]
|
||||
SaveScene(CaptureConfig),
|
||||
#[cfg(feature = "replay")]
|
||||
|
@ -362,7 +362,7 @@ impl SceneBuilderThread {
|
|||
break;
|
||||
}
|
||||
Ok(SceneBuilderRequest::ReportMemory(mut report, tx)) => {
|
||||
report += self.report_memory();
|
||||
(*report) += self.report_memory();
|
||||
tx.send(report).unwrap();
|
||||
}
|
||||
Ok(SceneBuilderRequest::SimulateLongSceneBuild(time_ms)) => {
|
||||
|
|
|
@ -1009,7 +1009,7 @@ pub enum ApiMsg {
|
|||
/// Flush from the caches anything that isn't necessary, to free some memory.
|
||||
MemoryPressure,
|
||||
/// Collects a memory report.
|
||||
ReportMemory(MsgSender<MemoryReport>),
|
||||
ReportMemory(MsgSender<Box<MemoryReport>>),
|
||||
/// Change debugging options.
|
||||
DebugCommand(DebugCommand),
|
||||
/// Wakes the render backend's event loop up. Needed when an event is communicated
|
||||
|
@ -1538,7 +1538,7 @@ impl RenderApi {
|
|||
pub fn report_memory(&self) -> MemoryReport {
|
||||
let (tx, rx) = channel::msg_channel().unwrap();
|
||||
self.api_sender.send(ApiMsg::ReportMemory(tx)).unwrap();
|
||||
rx.recv().unwrap()
|
||||
*rx.recv().unwrap()
|
||||
}
|
||||
|
||||
/// Update debugging flags.
|
||||
|
|
Загрузка…
Ссылка в новой задаче