summaryrefslogtreecommitdiff
path: root/src/malloc/mallocng/free.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/malloc/mallocng/free.c')
-rw-r--r--src/malloc/mallocng/free.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/malloc/mallocng/free.c b/src/malloc/mallocng/free.c
index 418a085c..43f32aad 100644
--- a/src/malloc/mallocng/free.c
+++ b/src/malloc/mallocng/free.c
@@ -119,7 +119,7 @@ void free(void *p)
if (((uintptr_t)(start-1) ^ (uintptr_t)end) >= 2*PGSZ && g->last_idx) {
unsigned char *base = start + (-(uintptr_t)start & (PGSZ-1));
size_t len = (end-base) & -PGSZ;
- if (len) {
+ if (len && USE_MADV_FREE) {
int e = errno;
madvise(base, len, MADV_FREE);
errno = e;