Commit 3f162d41 authored by ssid's avatar ssid Committed by Commit bot

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 method to return total of all spaces.

BUG=481504
LOG=N

Review URL: https://codereview.chromium.org/1141693003

Cr-Commit-Position: refs/heads/master@{#28566}
parent 7ffdb519
......@@ -229,8 +229,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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment