Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2946)

Unified Diff: runtime/vm/pages.h

Issue 227683004: Reset growth control state after isolate initialization. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/pages.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.h
===================================================================
--- runtime/vm/pages.h (revision 34778)
+++ runtime/vm/pages.h (working copy)
@@ -136,9 +136,13 @@
last_code_collection_in_us_ = t;
}
- void set_is_enabled(bool state) {
- is_enabled_ = state;
+ void Enable(SpaceUsage current) {
+ last_usage_ = current;
+ is_enabled_ = true;
}
+ void Disable() {
+ is_enabled_ = false;
+ }
bool is_enabled() {
return is_enabled_;
}
@@ -146,10 +150,10 @@
private:
bool is_enabled_;
- // Usage after last evaluated GC.
+ // Usage after last evaluated GC or last enabled.
SpaceUsage last_usage_;
- // Heap growth control variable.
+ // Pages of capacity growth allowed before next GC is advised.
intptr_t grow_heap_;
// If the garbage collector was not able to free more than heap_growth_ratio_
@@ -227,7 +231,11 @@
void StartEndAddress(uword* start, uword* end) const;
void SetGrowthControlState(bool state) {
- page_space_controller_.set_is_enabled(state);
+ if (state) {
+ page_space_controller_.Enable(usage_);
+ } else {
+ page_space_controller_.Disable();
+ }
}
bool GrowthControlState() {
« no previous file with comments | « no previous file | runtime/vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698