Skip to content

Commit b9d070f

Browse files
authored
An exception is thrown if a block of memory could not be allocated.
1 parent b1c01fc commit b9d070f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

deps/v8/src/heap/heap.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7653,6 +7653,7 @@ StrongRootAllocatorBase::StrongRootAllocatorBase(LocalIsolate* isolate)
76537653
// returns a pointer to Address 1.
76547654
Address* StrongRootAllocatorBase::allocate_impl(size_t n) {
76557655
void* block = base::Malloc(sizeof(StrongRootsEntry*) + n * sizeof(Address));
7656+
if(!block) heap()->FatalProcessOutOfMemory("StrongRootAllocatorBase::allocate_impl");
76567657

76577658
StrongRootsEntry** header = reinterpret_cast<StrongRootsEntry**>(block);
76587659
Address* ret = reinterpret_cast<Address*>(reinterpret_cast<char*>(block) +

0 commit comments

Comments
 (0)