Commit 1feae4cd authored by jl@opera.com's avatar jl@opera.com

PartitionAlloc: Count direct mapped pages as committed

Extend committed pages counting to direct mapped allocations as well. We
already did adjust the total committed pages size when reallocating a
direct mapped allocation to reflect the difference, but since we didn't do
any counting when initially mapping or when unmapping, this would just
result in accounting errors.

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

git-svn-id: svn://svn.chromium.org/blink/trunk@184169 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent f520ab26
......@@ -565,6 +565,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
......@@ -618,6 +620,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));
......
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