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

Unified Diff: src/heap.cc

Issue 4888001: Provide more accurate results about used heap size via GetHeapStatistics. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years, 1 month 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
« src/heap.h ('K') | « src/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 134f40e5070cf80d41978653d7406120d28a58fa..8cc6d7ee2409f71099fba04d4d2644091c078bcf 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -400,6 +400,17 @@ intptr_t Heap::SizeOfObjects() {
return total;
}
+intptr_t Heap::SizeOfObjectsSlow() {
+ intptr_t total = 0;
+ HeapIterator iterator;
+ for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
+ if (!FreeListNode::IsFreeListNode(obj)) {
+ total += obj->Size();
+ }
+ }
+ return total;
+}
+
void Heap::GarbageCollectionEpilogue() {
#ifdef DEBUG
allow_allocation(true);
« src/heap.h ('K') | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698