From 5d3b299209ee85958d8c2b46a2fc23d6d0f73544 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 2 Jan 2019 13:03:25 -0500 Subject: [PATCH] support random quarantine sizes other than 0 or 16 --- h_malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/h_malloc.c b/h_malloc.c index 5ea336f..2685d43 100644 --- a/h_malloc.c +++ b/h_malloc.c @@ -591,7 +591,7 @@ static inline void deallocate_small(void *p, const size_t *expected_size) { set_quarantine(metadata, slot); #if SLAB_QUARANTINE_RANDOM_SIZE > 0 - size_t random_index = get_random_u16_uniform(&c->rng, 16); + size_t random_index = get_random_u16_uniform(&c->rng, SLAB_QUARANTINE_RANDOM_SIZE); void *substitute = c->quarantine_random[random_index]; c->quarantine_random[random_index] = p;