Bug 1158445 - posix_madvise() should be used instead of madvise on Solaris. r=froydnj, r=jandem

This commit is contained in:
Petr Sumbera 2017-06-09 00:59:32 -07:00
parent b3ab3e52a0
commit 80944c40d8
2 changed files with 8 additions and 0 deletions

View File

@ -129,7 +129,11 @@ ReleaseRegion(void* aRegion, uintptr_t aSize)
static bool
ProbeRegion(uintptr_t aRegion, uintptr_t aSize)
{
#ifdef XP_SOLARIS
if (posix_madvise(reinterpret_cast<void*>(aRegion), aSize, POSIX_MADV_NORMAL)) {
#else
if (madvise(reinterpret_cast<void*>(aRegion), aSize, MADV_NORMAL)) {
#endif
return true;
} else {
return false;

View File

@ -269,7 +269,11 @@ ReleaseRegion(void* aPage)
static bool
ProbeRegion(uintptr_t aPage)
{
#ifdef XP_SOLARIS
return !!posix_madvise(reinterpret_cast<void*>(aPage), PageSize(), POSIX_MADV_NORMAL);
#else
return !!madvise(reinterpret_cast<void*>(aPage), PageSize(), MADV_NORMAL);
#endif
}
static int