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 #3826

Merged
merged 11 commits into from Jan 9, 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/6bf3305bb6893affecdbde816a7bf856a7ed13f1
  • Loading branch information
nical authored and moz-gfx committed Jan 8, 2020
commit 5ca15943e65a63c079d7913c7b5f132c17b4fe22
@@ -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.