Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Unified Diff: Source/platform/heap/Heap.cpp

Issue 1042263002: Oilpan: Make Oilpan crash at a never-inlined function when hitting OOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698