Bug 1542758 - mozjemalloc.cpp should use posix_madvise on Solaris r=glandium
authorPetr Sumbera <petr.sumbera@oracle.com>
Tue, 09 Apr 2019 08:20:48 +0000
changeset 468500 d9f68f966c69c21dde433bf15870d9c4609c8d61
parent 468499 9b115f2e5b2c9c82adf5ed6db9fef979a8e6a85c
child 468501 0a00348d14b809cf657733726d375bb77166bf0d
push id35841
push usercsabou@mozilla.com
push dateTue, 09 Apr 2019 16:23:02 +0000
treeherdermozilla-central@8e92ef0be5a1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1542758
milestone68.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 1542758 - mozjemalloc.cpp should use posix_madvise on Solaris r=glandium Differential Revision: https://phabricator.services.mozilla.com/D26529
memory/build/mozjemalloc.cpp
--- a/memory/build/mozjemalloc.cpp
+++ b/memory/build/mozjemalloc.cpp
@@ -2428,18 +2428,23 @@ void arena_t::Purge(bool aAll) {
 
 #ifdef MALLOC_DECOMMIT
         pages_decommit((void*)(uintptr_t(chunk) + (i << gPageSize2Pow)),
                        (npages << gPageSize2Pow));
 #endif
         mStats.committed -= npages;
 
 #ifndef MALLOC_DECOMMIT
+#ifdef XP_SOLARIS
+        posix_madvise((void*)(uintptr_t(chunk) + (i << gPageSize2Pow)),
+                (npages << gPageSize2Pow), MADV_FREE);
+#else
         madvise((void*)(uintptr_t(chunk) + (i << gPageSize2Pow)),
                 (npages << gPageSize2Pow), MADV_FREE);
+#endif
 #  ifdef MALLOC_DOUBLE_PURGE
         madvised = true;
 #  endif
 #endif
         if (mNumDirty <= (dirty_max >> 1)) {
           break;
         }
       }