Index: Source/wtf/PartitionAlloc.cpp |
diff --git a/Source/wtf/PartitionAlloc.cpp b/Source/wtf/PartitionAlloc.cpp |
index 47c06083b6b6e6cdfedba4bf6da6b415b2e64299..e2d122ef221edb23ec43b2d949eaf16940cb04f4 100644 |
--- a/Source/wtf/PartitionAlloc.cpp |
+++ b/Source/wtf/PartitionAlloc.cpp |
@@ -317,6 +317,23 @@ void partitionFreeSlowPath(PartitionPageHeader* page) |
} |
} |
+size_t partitionAllocGetUsedPagesSize(const PartitionRoot& root) |
+{ |
+ size_t total = 0; |
+ size_t i; |
+ for (i = 0; i < kNumBuckets; ++i) { |
+ const PartitionBucket& bucket = root.buckets[i]; |
+ total += bucket.numFullPages * kPartitionPageSize; |
+ const PartitionPageHeader* page = bucket.currPage; |
+ do { |
+ if (page != &bucket.root->seedPage) |
+ total += kPartitionPageSize; |
+ page = page->next; |
+ } while (page != bucket.currPage); |
+ } |
+ return total; |
+} |
+ |
#ifndef NDEBUG |
void partitionDumpStats(const PartitionRoot& root) |