Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync changes from mozilla-central #3828

Merged
merged 9 commits into from Jan 10, 2020

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

[wrupdater] From https://hg.mozilla.org/mozilla-central/rev/921c9f58037bf7c0c89b7c45c3f8a94f50b5814f
  • Loading branch information
nical authored and moz-gfx committed Jan 10, 2020
commit 3773fd73c16d23b9dee86e22227c89fd5f6619b0
@@ -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.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.