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

Unified Diff: runtime/vm/pages.h

Issue 1771503002: Ensure that calls to EnableGrowthControl/DisableGrowthControl does not reset the last_usage_ value … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « runtime/vm/heap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/pages.h
diff --git a/runtime/vm/pages.h b/runtime/vm/pages.h
index 12b193f64a01eb748db20435103a1df9260ee3d0..bd4ab5c5822340b37437b18da0e7784d98f1a592 100644
--- a/runtime/vm/pages.h
+++ b/runtime/vm/pages.h
@@ -141,8 +141,11 @@ class PageSpaceController {
last_code_collection_in_us_ = t;
}
- void Enable(SpaceUsage current) {
+ void set_last_usage(SpaceUsage current) {
last_usage_ = current;
+ }
+
+ void Enable() {
is_enabled_ = true;
}
void Disable() {
@@ -265,9 +268,14 @@ class PageSpace {
void StartEndAddress(uword* start, uword* end) const;
+ void InitGrowthControl() {
+ page_space_controller_.set_last_usage(usage_);
+ page_space_controller_.Enable();
+ }
+
void SetGrowthControlState(bool state) {
if (state) {
- page_space_controller_.Enable(usage_);
+ page_space_controller_.Enable();
} else {
page_space_controller_.Disable();
}
« no previous file with comments | « runtime/vm/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698