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

Unified Diff: include/v8-platform.h

Issue 2729413002: NotForReview: Expose the global memory budget (v8 side)
Patch Set: Created 3 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8-platform.h
diff --git a/include/v8-platform.h b/include/v8-platform.h
index e11567488b6a3ca45780d52d11d6d1b3696b44ba..41d2b40fbb2b23f047f9de41898eb00c99c4c10b 100644
--- a/include/v8-platform.h
+++ b/include/v8-platform.h
@@ -212,6 +212,24 @@ class Platform {
/** Removes tracing state change observer. */
virtual void RemoveTraceStateObserver(TraceStateObserver*) {}
+
+ /**
+ * Returns true if the system-wide available free memory (referred to as the
+ * global memory budget) can be obtained via GetGlobalMemoryBudget().
+ */
+ virtual bool IsGlobalMemoryBudgetAvailable() { return false; }
+
+ /**
+ * Returns the global memory budget. A nagative value can be returned when
+ * the global memory budget is unknown or the system is under high memory
+ * pressure.
+ */
+ virtual int64_t GetGlobalMemoryBudget() { return -1; }
+
+ /**
+ * TODO(bashi): Tentative. Set an interval to update the global memory budget.
+ */
+ virtual void SetGlobalMemoryBudgetUpdateInterval(uint32_t interval_ms) {}
};
} // namespace v8
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698