Revision: 11475
Author:   [email protected]
Date:     Wed May  2 02:25:23 2012
Log:      Merge r11471 from the bleeding_edge to the 3.9 branch.

Don't ignore return value of CommitCodePage in AllocateAlignedMemory.

Release the mapping as whole if commit failed to avoid leaking virtual address space.

[email protected]
BUG=chromium:118625

Review URL: https://chromiumcodereview.appspot.com/10260012
------------------------------------------------------------------------
Review URL: https://chromiumcodereview.appspot.com/10270015
http://code.google.com/p/v8/source/detail?r=11475

Modified:
 /branches/3.9/src/spaces.cc
 /branches/3.9/src/spaces.h
 /branches/3.9/src/version.cc

=======================================
--- /branches/3.9/src/spaces.cc Wed Apr 18 04:52:42 2012
+++ /branches/3.9/src/spaces.cc Wed May  2 02:25:23 2012
@@ -362,14 +362,21 @@
   if (base == NULL) return NULL;

   if (executable == EXECUTABLE) {
-    CommitCodePage(&reservation, base, size);
+    if (!CommitCodePage(&reservation, base, size)) {
+      base = NULL;
+    }
   } else {
-    if (!reservation.Commit(base,
-                            size,
-                            executable == EXECUTABLE)) {
-      return NULL;
+    if (!reservation.Commit(base, size, false)) {
+      base = NULL;
     }
   }
+
+  if (base == NULL) {
+    // Failed to commit the body. Release the mapping and any partially
+    // commited regions inside it.
+    reservation.Release();
+    return NULL;
+  }

   controller->TakeControl(&reservation);
   return base;
=======================================
--- /branches/3.9/src/spaces.h  Tue Mar 20 06:01:16 2012
+++ /branches/3.9/src/spaces.h  Wed May  2 02:25:23 2012
@@ -1040,7 +1040,9 @@
     return CodePageAreaEndOffset() - CodePageAreaStartOffset();
   }

- static bool CommitCodePage(VirtualMemory* vm, Address start, size_t size);
+  MUST_USE_RESULT static bool CommitCodePage(VirtualMemory* vm,
+                                             Address start,
+                                             size_t size);

  private:
   Isolate* isolate_;
=======================================
--- /branches/3.9/src/version.cc        Thu Apr 26 05:01:49 2012
+++ /branches/3.9/src/version.cc        Wed May  2 02:25:23 2012
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     9
 #define BUILD_NUMBER      24
-#define PATCH_LEVEL       17
+#define PATCH_LEVEL       18
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0

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

Reply via email to