Propagate madvise() success/failure from pages_purge_lazy().
This commit is contained in:
parent
64e458f5cd
commit
afb46ce236
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user