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

Unified Diff: src/heap/heap.h

Issue 2624973003: [heap] Add API function for checking if the heap limit was increased (Closed)
Patch Set: fix comment Created 3 years, 11 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 | « src/api.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 4a7ba35e42be1346c6db0f96909af7db1ed38f1e..2a57ea5d619acdc17db4eb2036f3ec27e80f0c0f 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -956,13 +956,16 @@ class Heap {
return memory_pressure_level_.Value() != MemoryPressureLevel::kNone;
}
- void IncreaseHeapLimitForDebugging() {
+ size_t HeapLimitForDebugging() {
const size_t kDebugHeapSizeFactor = 4;
size_t max_limit = std::numeric_limits<size_t>::max() / 4;
+ return Min(max_limit,
+ initial_max_old_generation_size_ * kDebugHeapSizeFactor);
+ }
+
+ void IncreaseHeapLimitForDebugging() {
max_old_generation_size_ =
- Max(max_old_generation_size_,
- Min(max_limit,
- initial_max_old_generation_size_ * kDebugHeapSizeFactor));
+ Max(max_old_generation_size_, HeapLimitForDebugging());
}
void RestoreOriginalHeapLimit() {
@@ -973,6 +976,10 @@ class Heap {
Max(initial_max_old_generation_size_, min_limit));
}
+ bool IsHeapLimitIncreasedForDebugging() {
+ return max_old_generation_size_ == HeapLimitForDebugging();
+ }
+
// ===========================================================================
// Initialization. ===========================================================
// ===========================================================================
« no previous file with comments | « src/api.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698