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

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: Review feedback. 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..31c41aec2d3c790f096a70652a02c060bd1c1ecf 100644
--- a/Source/wtf/PartitionAlloc.cpp
+++ b/Source/wtf/PartitionAlloc.cpp
@@ -896,7 +896,7 @@ static ALWAYS_INLINE void partitionRegisterEmptyPage(PartitionPage* page)
root->globalEmptyPageRingIndex = currentIndex;
}
-static void partitionDecommitFreePages(PartitionRootBase* root)
+static void partitionDecommitEmptyPages(PartitionRootBase* root)
{
for (size_t i = 0; i < kMaxFreeableSpans; ++i) {
PartitionPage* page = root->globalEmptyPageRing[i];
@@ -906,15 +906,17 @@ static void partitionDecommitFreePages(PartitionRootBase* root)
}
}
-void partitionPurgeMemory(PartitionRoot* root)
+void partitionPurgeMemory(PartitionRoot* root, int flags)
{
- partitionDecommitFreePages(root);
+ if (flags & PartitionPurgeDecommitEmptyPages)
+ partitionDecommitEmptyPages(root);
}
-void partitionPurgeMemoryGeneric(PartitionRootGeneric* root)
+void partitionPurgeMemoryGeneric(PartitionRootGeneric* root, int flags)
{
spinLockLock(&root->lock);
- partitionDecommitFreePages(root);
+ if (flags & PartitionPurgeDecommitEmptyPages)
+ partitionDecommitEmptyPages(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;
++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