Call the (fatal) V8 out of memory handler if we cannot allocate enough

memory from the OS to deserialize the initial heap snapshot at
startup.

This catches the failure to startup earlier, and avoids dereferencing
the encoding of an allocation failure.

BUG=16359

Review URL: http://codereview.chromium.org/159265

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2526 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 270c0e8b
......@@ -1454,9 +1454,9 @@ void Deserializer::GetLog() {
static void InitPagedSpace(PagedSpace* space,
int capacity,
List<Page*>* page_list) {
space->EnsureCapacity(capacity);
// TODO(1240712): PagedSpace::EnsureCapacity can return false due to
// a failure to allocate from the OS to expand the space.
if (!space->EnsureCapacity(capacity)) {
V8::FatalProcessOutOfMemory("InitPagedSpace");
}
PageIterator it(space, PageIterator::ALL_PAGES);
while (it.has_next()) page_list->Add(it.next());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment