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. =========================================================== |
// =========================================================================== |