Commit fea1d2b1 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fix PagedSpace size accounting.

R=hpayer@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22433 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent f3c83ebe
......@@ -3947,6 +3947,7 @@ static intptr_t Free(PagedSpace* space,
if (mode == MarkCompactCollector::SWEEP_ON_MAIN_THREAD) {
return space->Free(start, size);
} else {
// TODO(hpayer): account for wasted bytes in concurrent sweeping too.
return size - free_list->Free(start, size);
}
}
......
......@@ -1457,9 +1457,8 @@ class AllocationStats BASE_EMBEDDED {
// Waste free bytes (available -> waste).
void WasteBytes(int size_in_bytes) {
size_ -= size_in_bytes;
ASSERT(size_in_bytes >= 0);
waste_ += size_in_bytes;
ASSERT(size_ >= 0);
}
private:
......@@ -1857,7 +1856,8 @@ class PagedSpace : public Space {
// no attempt to add area to free list is made.
int Free(Address start, int size_in_bytes) {
int wasted = free_list_.Free(start, size_in_bytes);
accounting_stats_.DeallocateBytes(size_in_bytes - wasted);
accounting_stats_.DeallocateBytes(size_in_bytes);
accounting_stats_.WasteBytes(wasted);
return size_in_bytes - wasted;
}
......
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