Chromium Code Reviews| Index: Source/platform/heap/HeapPage.cpp |
| diff --git a/Source/platform/heap/HeapPage.cpp b/Source/platform/heap/HeapPage.cpp |
| index 7733e6875fa651b1ef1e793a532c5a26cac8a169..1df859beb29f280c24a9199444469cc4ebe7220f 100644 |
| --- a/Source/platform/heap/HeapPage.cpp |
| +++ b/Source/platform/heap/HeapPage.cpp |
| @@ -521,9 +521,8 @@ void NormalPageHeap::allocatePage() |
| { |
| threadState()->shouldFlushHeapDoesNotContainCache(); |
| PageMemory* pageMemory = Heap::freePagePool()->takeFreePage(heapIndex()); |
| - // We continue allocating page memory until we succeed in committing one. |
| - size_t numberOfTrials = 0; |
| - while (!pageMemory) { |
| + |
| + if (!pageMemory) { |
| // Allocate a memory region for blinkPagesPerRegion pages that |
| // will each have the following layout. |
| // |
| @@ -537,20 +536,17 @@ void NormalPageHeap::allocatePage() |
| // Take the first possible page ensuring that this thread actually |
| // gets a page and add the rest to the page pool. |
| if (!pageMemory) { |
| - if (memory->commit()) |
| - pageMemory = memory; |
| - else |
| - delete memory; |
| + bool result = memory->commit(); |
| + // If you hit the ASSERT, it will mean that you're hitting |
| + // the limit of the number of mmapped regions OS can support |
| + // (e.g., /proc/sys/vm/max_map_count in Linux). |
| + RELEASE_ASSERT(result); |
|
sof
2015/09/08 07:13:11
Don't you need to assign pageMemory?
|
| } else { |
| Heap::freePagePool()->addFreePage(heapIndex(), memory); |
| } |
| } |
| - ++numberOfTrials; |
| - // If you hit the ASSERT, it means that you're hitting the limit of |
| - // the number of mmapped regions OS can support |
| - // (e.g., /proc/sys/vm/max_map_count in Linux). |
| - RELEASE_ASSERT(numberOfTrials < 64); |
| } |
| + |
| NormalPage* page = new (pageMemory->writableStart()) NormalPage(pageMemory, this); |
| page->link(&m_firstPage); |