From f9a8e7216bdcba5f1f25b9f5e1a3aac665b73329 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 12 May 2021 00:39:36 -0400 Subject: [PATCH] purge slab memory even if using MAP_FIXED fails --- h_malloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/h_malloc.c b/h_malloc.c index 8f1d721..a091791 100644 --- a/h_malloc.c +++ b/h_malloc.c @@ -760,8 +760,10 @@ static inline void deallocate_small(void *p, const size_t *expected_size) { enqueue_free_slab(c, metadata); mutex_unlock(&c->lock); return; + } else { + memory_purge(slab, slab_size); + // handle out-of-memory by putting it into the empty slabs list } - // handle out-of-memory by just putting it into the empty slabs list } metadata->next = c->empty_slabs;