Bug 1020517 - OdinMonkey: Loosen the munmap assert to ignore ENOMEM r=luke
authorDan Gohman <sunfish@mozilla.com>
Fri, 06 Jun 2014 15:59:17 -0700
changeset 206597 b0561d529f9587dd26c9174150e031a41eed433f
parent 206596 5f6ae40e368d7acf69cd21df653a761c5784d858
child 206598 4f059440e912584e98e45775578c323d1eab2e66
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1020517
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1020517 - OdinMonkey: Loosen the munmap assert to ignore ENOMEM r=luke
js/src/jit/AsmJSModule.cpp
--- a/js/src/jit/AsmJSModule.cpp
+++ b/js/src/jit/AsmJSModule.cpp
@@ -1,16 +1,18 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sts=4 et sw=4 tw=99:
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "jit/AsmJSModule.h"
 
+#include <errno.h>
+
 #ifndef XP_WIN
 # include <sys/mman.h>
 #endif
 
 #include "mozilla/Compression.h"
 #include "mozilla/PodOperations.h"
 
 #include "jslibmath.h"
@@ -92,17 +94,17 @@ AllocateExecutableMemory(ExclusiveContex
 }
 
 static void
 DeallocateExecutableMemory(uint8_t *code, size_t totalBytes)
 {
 #ifdef XP_WIN
     JS_ALWAYS_TRUE(VirtualFree(code, 0, MEM_RELEASE));
 #else
-    JS_ALWAYS_TRUE(munmap(code, totalBytes) == 0);
+    JS_ALWAYS_TRUE(munmap(code, totalBytes) == 0 || errno == ENOMEM);
 #endif
 }
 
 bool
 AsmJSModule::allocateAndCopyCode(ExclusiveContext *cx, MacroAssembler &masm)
 {
     JS_ASSERT(!code_);