support random quarantine sizes other than 0 or 16
parent
418cb1609c
commit
5d3b299209
|
@ -591,7 +591,7 @@ static inline void deallocate_small(void *p, const size_t *expected_size) {
|
||||||
set_quarantine(metadata, slot);
|
set_quarantine(metadata, slot);
|
||||||
|
|
||||||
#if SLAB_QUARANTINE_RANDOM_SIZE > 0
|
#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];
|
void *substitute = c->quarantine_random[random_index];
|
||||||
c->quarantine_random[random_index] = p;
|
c->quarantine_random[random_index] = p;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue