From 4924c0959034aff7da94b9c524f947a09bbd0024 Mon Sep 17 00:00:00 2001 From: Petr Sumbera Date: Mon, 22 May 2017 04:16:12 -0700 Subject: [PATCH] Bug 963983 - posix_madvise() should be used instead of madvise() on Solaris. r=jandem --- js/src/gc/Memory.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp index 21531adc48d4..886b1926271c 100644 --- a/js/src/gc/Memory.cpp +++ b/js/src/gc/Memory.cpp @@ -766,7 +766,11 @@ MarkPagesUnused(void* p, size_t size) return false; MOZ_ASSERT(OffsetFromAligned(p, pageSize) == 0); +#if defined(XP_SOLARIS) + int result = posix_madvise(p, size, POSIX_MADV_DONTNEED); +#else int result = madvise(p, size, MADV_DONTNEED); +#endif return result != -1; }