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

Implement discarding Document objects to reclaim space. #14312

Merged
merged 5 commits into from Jan 4, 2017
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Added warnings for idempotent freeze/thaw.

  • Loading branch information
asajeffrey committed Jan 4, 2017
commit 67bf23016e48f6aab7c3c5556a86226783a8c55d
@@ -229,7 +229,9 @@ impl OneshotTimers {

pub fn suspend(&self) {
// Suspend is idempotent: do nothing if the timers are already suspended.

This comment has been minimized.

@cbrewster

cbrewster Jan 3, 2017

Member

While I think making freeze/thaw/suspend idempotent isn't a bad idea, I think it can let some issues fall through the cracks. For example #13716 is caused by a some Pipelines not being frozen when navigated from. We would have no idea that this was happening if suspend was idempotent. At a minimum, it might be nice to add a warn! when returning early here and in resume

This comment has been minimized.

@asajeffrey

asajeffrey Jan 4, 2017

Author Member

Added warnings.

if self.suspended_since.get().is_some() { return; }
if self.suspended_since.get().is_some() {
return warn!("Suspending an already suspended timer.");
}

self.suspended_since.set(Some(precise_time_ms()));
self.invalidate_expected_event_id();
@@ -239,7 +241,7 @@ impl OneshotTimers {
// Suspend is idempotent: do nothing if the timers are already suspended.
let additional_offset = match self.suspended_since.get() {
Some(suspended_since) => precise_time_ms() - suspended_since,
None => return,
None => return warn!("Resuming an already resumed timer."),
};

self.suspension_offset.set(self.suspension_offset.get() + additional_offset);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.