Revision: 2526
Author: [email protected]
Date: Thu Jul 23 05:56:45 2009
Log: 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
http://code.google.com/p/v8/source/detail?r=2526

Modified:
  /branches/bleeding_edge/src/serialize.cc

=======================================
--- /branches/bleeding_edge/src/serialize.cc    Thu Jul  9 04:13:08 2009
+++ /branches/bleeding_edge/src/serialize.cc    Thu Jul 23 05:56:45 2009
@@ -1454,9 +1454,9 @@
  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());
  }

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to