Chromium Code Reviews| 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) { |
|
Chris Evans
2014/11/07 03:33:23
Nit: maybe add comment? Something like "If we get
Jens Widell
2014/11/07 14:17:31
Done.
|
| + 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) |
|
Chris Evans
2014/11/07 03:33:23
Nit: add UNLIKELY!
Jens Widell
2014/11/07 14:17:31
Done.
|
| + 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 |