Bug 1527597 - ReserveProcessExecutableMemory should use MAP_NORESERVE r=jandem
authorPetr Sumbera <petr.sumbera@oracle.com>
Fri, 18 Oct 2019 10:12:15 +0000
changeset 559456 8cc5f974bbd0b29acccbdd54431d0a64d8fd70c1
parent 559455 f3dc2fd05ffe20684f9f5ba1c1e2341b9ac86b36
child 559457 b37f26560af018441cba447894ef75a7e8bccfcf
push id12177
push usercsabou@mozilla.com
push dateMon, 21 Oct 2019 14:52:16 +0000
treeherdermozilla-beta@1918a9cd33bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1527597
milestone71.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 1527597 - ReserveProcessExecutableMemory should use MAP_NORESERVE r=jandem Differential Revision: https://phabricator.services.mozilla.com/D49612
js/src/jit/ProcessExecutableMemory.cpp
--- a/js/src/jit/ProcessExecutableMemory.cpp
+++ b/js/src/jit/ProcessExecutableMemory.cpp
@@ -339,18 +339,18 @@ static void* ComputeRandomAllocationAddr
   return (void*)uintptr_t(rand & mask);
 }
 
 static void* ReserveProcessExecutableMemory(size_t bytes) {
   // Note that randomAddr is just a hint: if the address is not available
   // mmap will pick a different address.
   void* randomAddr = ComputeRandomAllocationAddress();
   void* p = MozTaggedAnonymousMmap(randomAddr, bytes, PROT_NONE,
-                                   MAP_PRIVATE | MAP_ANON, -1, 0,
-                                   "js-executable-memory");
+                                   MAP_NORESERVE | MAP_PRIVATE | MAP_ANON, -1,
+                                   0, "js-executable-memory");
   if (p == MAP_FAILED) {
     return nullptr;
   }
   return p;
 }
 
 static void DeallocateProcessExecutableMemory(void* addr, size_t bytes) {
   mozilla::DebugOnly<int> result = munmap(addr, bytes);