From afb46ce23617f1315a6e75f846fd4169e8aaa455 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Wed, 15 Mar 2017 13:09:43 -0700 Subject: [PATCH] Propagate madvise() success/failure from pages_purge_lazy(). --- src/pages.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages.c b/src/pages.c index 9846e19e..fa986ba6 100644 --- a/src/pages.c +++ b/src/pages.c @@ -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