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

Unified Diff: src/heap/heap.h

Issue 1864433003: [heap] Old generation limit is based on capacity. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | src/heap/heap.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 74b9d85a15aed7ce8ec43fd23986cfa8cd01b7c8..ecb08fb0a77cdec86a7568000d1a586570853532 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -625,11 +625,9 @@ class Heap {
return old_space_->allocation_limit_address();
}
- // TODO(hpayer): There is still a missmatch between capacity and actual
- // committed memory size.
- bool CanExpandOldGeneration(int size = 0) {
+ bool CanExpandOldGeneration(int size) {
if (force_oom_) return false;
- return (CommittedOldGenerationMemory() + size) < MaxOldGenerationSize();
+ return (OldGenerationCapacity() + size) < MaxOldGenerationSize();
}
// Clear the Instanceof cache (used when a prototype changes).
@@ -1192,6 +1190,9 @@ class Heap {
// more spaces are needed until it reaches the limit.
intptr_t Capacity();
+ // Returns the capacity of the old generation.
+ intptr_t OldGenerationCapacity();
+
// Returns the amount of memory currently committed for the heap.
intptr_t CommittedMemory();
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698