Propagate madvise() success/failure from pages_purge_lazy().

This commit is contained in:
Jason Evans 2017-03-15 13:09:43 -07:00
parent 64e458f5cd
commit afb46ce236

View File

@ -180,15 +180,15 @@ pages_purge_lazy(void *addr, size_t size) {
#ifdef _WIN32
VirtualAlloc(addr, size, MEM_RESET, PAGE_READWRITE);
return false;
#elif defined(JEMALLOC_PURGE_MADVISE_FREE)
madvise(addr, size, MADV_FREE);
return (madvise(addr, size, MADV_FREE) != 0);
#elif defined(JEMALLOC_PURGE_MADVISE_DONTNEED) && \
!defined(JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS)
madvise(addr, size, MADV_DONTNEED);
return (madvise(addr, size, MADV_DONTNEED) != 0);
#else
not_reached();
#endif
return false;
}
bool