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

Unified Diff: Source/wtf/PartitionAlloc.cpp

Issue 649583004: PartitionAlloc: Count direct mapped pages as committed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: restrict to fix direct map accounting Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/PartitionAlloc.cpp
diff --git a/Source/wtf/PartitionAlloc.cpp b/Source/wtf/PartitionAlloc.cpp
index 3ba965297d9ba85cbd9dd873a8778b2de68e049e..8ad6d617d30cf51d52ad38f97b3a1778b1b16d71 100644
--- a/Source/wtf/PartitionAlloc.cpp
+++ b/Source/wtf/PartitionAlloc.cpp
@@ -578,6 +578,8 @@ static ALWAYS_INLINE void* partitionDirectMap(PartitionRootBase* root, int flags
mapSize += kPageAllocationGranularityOffsetMask;
mapSize &= kPageAllocationGranularityBaseMask;
+ root->totalSizeOfCommittedPages += size + kSystemPageSize;
+
// TODO: we may want to let the operating system place these allocations
// where it pleases. On 32-bit, this might limit address space
// fragmentation and on 64-bit, this might have useful savings for TLB
@@ -634,6 +636,9 @@ static ALWAYS_INLINE void partitionDirectUnmap(PartitionPage* page)
// page.
unmapSize += kPartitionPageSize + kSystemPageSize;
+ PartitionRootBase* root = partitionPageToRoot(page);
+ root->totalSizeOfCommittedPages -= page->bucket->slotSize + kSystemPageSize;
+
ASSERT(!(unmapSize & kPageAllocationGranularityOffsetMask));
char* ptr = reinterpret_cast<char*>(partitionPageToPointer(page));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698