support random quarantine sizes other than 0 or 16

This commit is contained in:
Daniel Micay 2019-01-02 13:03:25 -05:00
parent 418cb1609c
commit 5d3b299209

View File

@ -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;