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

Unified Diff: Source/wtf/PartitionAlloc.cpp

Issue 1190173003: PartitionAlloc: API changes to support new partitionPurgeMemoryGeneric() mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « Source/wtf/PartitionAlloc.h ('k') | Source/wtf/PartitionAllocTest.cpp » ('j') | 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 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;
« no previous file with comments | « Source/wtf/PartitionAlloc.h ('k') | Source/wtf/PartitionAllocTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698