| Index: Source/wtf/PartitionAlloc.h
|
| diff --git a/Source/wtf/PartitionAlloc.h b/Source/wtf/PartitionAlloc.h
|
| index 5dbdb487add327bba0beee4d6271e2f42f0f5479..59db16ab084d28e0edec7974ae8c073ca0f02f54 100644
|
| --- a/Source/wtf/PartitionAlloc.h
|
| +++ b/Source/wtf/PartitionAlloc.h
|
| @@ -376,6 +376,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);
|
| @@ -478,7 +483,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);
|
| @@ -525,6 +530,7 @@ ALWAYS_INLINE size_t* partitionPageGetRawSizePtr(PartitionPage* page)
|
| if (bucket->slotSize <= kMaxSystemPagesPerSlotSpan * kSystemPageSize)
|
| return nullptr;
|
|
|
| + ASSERT((bucket->slotSize % kSystemPageSize) == 0);
|
| ASSERT(partitionBucketIsDirectMapped(bucket) || partitionBucketSlots(bucket) == 1);
|
| page++;
|
| return reinterpret_cast<size_t*>(&page->freelistHead);
|
|
|