Bug 1299330 - Unbreak build on BSDs after bug 1287967. r?luke draft
authorJan Beich <jbeich@FreeBSD.org>
Tue, 30 Aug 2016 23:09:44 +0000
changeset 407783 4bfba4cb413dccfe834af2f2cf5596d8fe20f9ee
parent 407782 41d8277af19246308bdf51bf0cd60da3498681b1
child 529946 294cd639f6a3998a8bee8300de26903667c56389
push id28040
push userbmo:jbeich@FreeBSD.org
push dateWed, 31 Aug 2016 00:17:23 +0000
reviewersluke
bugs1299330, 1287967
milestone51.0a1
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;
     }
 };