Bug 1299330 - Unbreak build on BSDs after bug 1287967. r=luke
authorJan Beich <jbeich@FreeBSD.org>
Tue, 30 Aug 2016 23:09:44 +0000
changeset 353368 bccb467cbc4f7f409185efbc979e7fd4301d8483
parent 353367 9d6202dd9a58986cfe11a9bdd65234777f230585
child 353369 5f2944711e5cd62cbc03b0e9dbb59f257ac5aa8b
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1299330, 1287967
milestone51.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 1299330 - Unbreak build on BSDs after bug 1287967. r=luke MozReview-Commit-ID: KfZItwYpnzc
js/src/vm/ArrayBufferObject.cpp
--- a/js/src/vm/ArrayBufferObject.cpp
+++ b/js/src/vm/ArrayBufferObject.cpp
@@ -546,24 +546,24 @@ class js::WasmArrayRawBuffer
         MOZ_RELEASE_ASSERT(newMax.isValid());
         MOZ_RELEASE_ASSERT(newMax.value() % wasm::PageSize == 0);
 
         size_t newMapped = wasm::LegalizeMapLength(newMax.value());
 
 # ifdef XP_WIN
         if (!VirtualAlloc(dataPointer(), newMapped, MEM_RESERVE, PAGE_NOACCESS))
             return;
-# elif defined(XP_DARWIN)
+# elif defined(XP_LINUX)
+        // Note this will not move memory (no MREMAP_MAYMOVE specified)
+        if (MAP_FAILED == mremap(dataPointer(), mappedSize_, newMapped, 0))
+            return;
+# else
         // No mechanism for remapping on MaxOS. Luckily shouldn't need it here
         // as most MacOS configs are 64 bit
         return;
-#else // Unix
-        // Note this will not move memory (no MREMAP_MAYMOVE specified)
-        if (MAP_FAILED == mremap(dataPointer(), mappedSize_, newMapped, 0))
-            return;
 # endif  // !XP_WIN
 
         mappedSize_ = newMapped;
         maxSize_ = Some(newMax.value());
         return;
     }
 };