Chromium Code Reviews| Index: Source/platform/heap/Heap.cpp |
| diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp |
| index b9a060001ee7f877b1a052cae6589e4f2cfc2f40..de55d5dcfef43123190d561708c531f99cb76682 100644 |
| --- a/Source/platform/heap/Heap.cpp |
| +++ b/Source/platform/heap/Heap.cpp |
| @@ -170,6 +170,11 @@ private: |
| size_t m_size; |
| }; |
| +static NEVER_INLINE void blinkGCOutOfMemory() |
| +{ |
| + IMMEDIATE_CRASH(); |
|
sof
2015/03/30 08:06:33
Could you mimic PartitionAlloc's partitionOutOfMem
haraken
2015/03/30 09:24:13
I investigated but it seems it's involved (we need
|
| +} |
| + |
| // A PageMemoryRegion represents a chunk of reserved virtual address |
| // space containing a number of blink heap pages. On Windows, reserved |
| // virtual address space can only be given back to the system as a |
| @@ -248,7 +253,8 @@ private: |
| // Round size up to the allocation granularity. |
| size = (size + WTF::kPageAllocationGranularityOffsetMask) & WTF::kPageAllocationGranularityBaseMask; |
| Address base = static_cast<Address>(WTF::allocPages(nullptr, size, blinkPageSize)); |
| - RELEASE_ASSERT(base); |
| + if (!base) |
| + blinkGCOutOfMemory(); |
| WTF::setSystemPagesInaccessible(base, size); |
| return new PageMemoryRegion(base, size, numPages); |
| } |