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

Unified Diff: Source/wtf/PartitionAlloc.cpp

Issue 1155293007: Expose ReleaseFreeMemory to free up memory on memory pressure or idle cleanup. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixing test calls. 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 d6fc5a6cdf2ebc3ca117b5909026b9ac4a315369..b714574e7f66025ba424bdf759b6b3c5da93e8ce 100644
--- a/Source/wtf/PartitionAlloc.cpp
+++ b/Source/wtf/PartitionAlloc.cpp
@@ -863,7 +863,7 @@ static ALWAYS_INLINE void partitionRegisterEmptyPage(PartitionPage* page)
root->globalEmptyPageRingIndex = currentIndex;
}
-void partitionPurgeMemory(PartitionRootBase* root)
+static void partitionDecommitFreePages(PartitionRootBase* root)
{
for (size_t i = 0; i < kMaxFreeableSpans; ++i) {
PartitionPage* page = root->globalEmptyPageRing[i];
@@ -873,6 +873,18 @@ void partitionPurgeMemory(PartitionRootBase* root)
}
}
+void partitionPurgeMemory(PartitionRoot* root)
+{
+ partitionDecommitFreePages(root);
+}
+
+void partitionPurgeMemoryGeneric(PartitionRootGeneric* root)
+{
+ spinLockLock(&root->lock);
+ partitionDecommitFreePages(root);
+ spinLockUnlock(&root->lock);
+}
+
void partitionFreeSlowPath(PartitionPage* page)
{
PartitionBucket* bucket = page->bucket;
« 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