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

Unified Diff: src/spaces.h

Issue 392163003: Fix PagedSpace size accounting. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | « src/mark-compact.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index efed18ec6d4778c26ef7bd1fd1067e68230b43ff..2e6c0b938c5fdf0f96f5e955d5c0d3f26645bbe2 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -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;
}
« no previous file with comments | « src/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698