Index: Source/wtf/PartitionAlloc.cpp |
diff --git a/Source/wtf/PartitionAlloc.cpp b/Source/wtf/PartitionAlloc.cpp |
index ab14a4328f122cd7b2e7b56e31c6fc83aadc98c6..2ba64d1a1d147464c100a70711206094bc3c329a 100644 |
--- a/Source/wtf/PartitionAlloc.cpp |
+++ b/Source/wtf/PartitionAlloc.cpp |
@@ -699,8 +699,10 @@ void* partitionAllocSlowPath(PartitionRootBase* root, int flags, size_t size, Pa |
return partitionPageAllocAndFillFreelist(newPage); |
partitionAllocSlowPathFailed: |
- if (returnNull) |
+ if (returnNull) { |
+ bucket->activePagesHead = &PartitionRootGeneric::gSeedPage; |
return nullptr; |
+ } |
partitionOutOfMemory(); |
return nullptr; |
} |
@@ -763,7 +765,6 @@ void partitionFreeSlowPath(PartitionPage* page) |
{ |
PartitionBucket* bucket = page->bucket; |
ASSERT(page != &PartitionRootGeneric::gSeedPage); |
- ASSERT(bucket->activePagesHead != &PartitionRootGeneric::gSeedPage); |
if (LIKELY(page->numAllocatedSlots == 0)) { |
// Page became fully unused. |
if (UNLIKELY(partitionBucketIsDirectMapped(bucket))) { |
@@ -801,7 +802,10 @@ void partitionFreeSlowPath(PartitionPage* page) |
// non-full page list. Also make it the current page to increase the |
// chances of it being filled up again. The old current page will be |
// the next page. |
- page->nextPage = bucket->activePagesHead; |
+ if (bucket->activePagesHead == &PartitionRootGeneric::gSeedPage) |
+ page->nextPage = 0; |
+ else |
+ page->nextPage = bucket->activePagesHead; |
bucket->activePagesHead = page; |
--bucket->numFullPages; |
// Special case: for a partition page with just a single slot, it may |