Reviewers: rmcilroy, jochen (traveling),
Message:
Small fix. PTAL
Description:
Fixing Heap::Available() to return total of all spaces.
The Heap::Available method adds up the available size from only 4 of
the spaces. This CL fixes the methos to return total of all spaces.
BUG=481504
LOG=N
Please review this at https://codereview.chromium.org/1141693003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+6, -2 lines):
M src/heap/heap.cc
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index
99f2e93f505f78a4d3894f828083d41b42d3decd..50b26820dfeccc7a4db37027e6bd9ec52f022857
100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -227,8 +227,12 @@ void Heap::UpdateMaximumCommitted() {
intptr_t Heap::Available() {
if (!HasBeenSetUp()) return 0;
- return new_space_.Available() + old_space_->Available() +
- code_space_->Available() + map_space_->Available();
+ intptr_t total = 0;
+ AllSpaces spaces(this);
+ for (Space* space = spaces.next(); space != NULL; space = spaces.next())
{
+ total += space->Available();
+ }
+ return total;
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.