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

Unified Diff: Source/wtf/PartitionAlloc.h

Issue 1197753003: PartitionAlloc: implement discarding for partitionPurgeMemoryGeneric(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@rawsize
Patch Set: Add missing comment. 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 | « no previous file | Source/wtf/PartitionAlloc.cpp » ('j') | Source/wtf/PartitionAlloc.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/PartitionAlloc.h
diff --git a/Source/wtf/PartitionAlloc.h b/Source/wtf/PartitionAlloc.h
index 48e71045f9aa2161ecf0f0f88b85746078b09e6c..a8bc399ebb892318ddaa3c01d5f506d4e1342825 100644
--- a/Source/wtf/PartitionAlloc.h
+++ b/Source/wtf/PartitionAlloc.h
@@ -375,6 +375,11 @@ WTF_EXPORT bool partitionAllocGenericShutdown(PartitionRootGeneric*);
enum PartitionPurgeFlags {
// Decommitting the ring list of empty pages is reasonably fast.
PartitionPurgeDecommitEmptyPages = 1 << 0,
+ // Discarding unused system pages is slower, because it involves walking all
+ // freelists in all active partition pages of all buckets >= system page
+ // size. It often frees a similar amount of memory to decommitting the empty
+ // pages, though.
+ PartitionPurgeDiscardUnusedSystemPages = 1 << 1,
};
WTF_EXPORT void partitionPurgeMemory(PartitionRoot*, int);
@@ -477,7 +482,7 @@ ALWAYS_INLINE PartitionPage* partitionPointerToPageNoAlignmentCheck(void* ptr)
return page;
}
-ALWAYS_INLINE void* partitionPageToPointer(PartitionPage* page)
+ALWAYS_INLINE void* partitionPageToPointer(const PartitionPage* page)
{
uintptr_t pointerAsUint = reinterpret_cast<uintptr_t>(page);
uintptr_t superPageOffset = (pointerAsUint & kSuperPageOffsetMask);
« no previous file with comments | « no previous file | Source/wtf/PartitionAlloc.cpp » ('j') | Source/wtf/PartitionAlloc.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698