Chromium Code Reviews| Index: Source/wtf/PartitionAlloc.cpp |
| diff --git a/Source/wtf/PartitionAlloc.cpp b/Source/wtf/PartitionAlloc.cpp |
| index 149730b1fd3152476404bdc6a52fcb4093a71669..f5c1dcfd792ad0ba61157bcd20bdc93d764f004b 100644 |
| --- a/Source/wtf/PartitionAlloc.cpp |
| +++ b/Source/wtf/PartitionAlloc.cpp |
| @@ -906,15 +906,17 @@ static void partitionDecommitFreePages(PartitionRootBase* root) |
| } |
| } |
| -void partitionPurgeMemory(PartitionRoot* root) |
| +void partitionPurgeMemory(PartitionRoot* root, int flags) |
| { |
| - partitionDecommitFreePages(root); |
| + if (flags & PartitionPurgeDecommitEmptyPages) |
| + partitionDecommitFreePages(root); |
|
haraken
2015/06/18 18:00:10
Nit: We might want to rename this function to part
|
| } |
| -void partitionPurgeMemoryGeneric(PartitionRootGeneric* root) |
| +void partitionPurgeMemoryGeneric(PartitionRootGeneric* root, int flags) |
| { |
| spinLockLock(&root->lock); |
| - partitionDecommitFreePages(root); |
| + if (flags & PartitionPurgeDecommitEmptyPages) |
| + partitionDecommitFreePages(root); |
| spinLockUnlock(&root->lock); |
| } |
| @@ -1100,7 +1102,7 @@ static void partitionDumpPageStats(PartitionBucketMemoryStats* statsOut, const P |
| size_t pageBytesResidentRounded = partitionRoundUpToSystemPage(pageBytesResident); |
| statsOut->residentBytes += pageBytesResidentRounded; |
| if (!page->numAllocatedSlots) { |
| - statsOut->freeableBytes += pageBytesResidentRounded; |
| + statsOut->decommittableBytes += pageBytesResidentRounded; |
|
haraken
2015/06/18 18:00:10
Here we're adding pageBytesResidentRounded to both
|
| ++statsOut->numEmptyPages; |
| } else if (page->numAllocatedSlots == bucketNumSlots) { |
| ++statsOut->numFullPages; |