From f11c448a0d21c863c2d8cb630ada6763f931f1d2 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 14 Oct 2018 15:09:55 -0400 Subject: [PATCH] slightly reorganize slab metadata --- malloc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/malloc.c b/malloc.c index eff660a..5ca2b97 100644 --- a/malloc.c +++ b/malloc.c @@ -123,8 +123,11 @@ static const size_t max_empty_slabs_total = 64 * 1024; static struct size_class { struct mutex lock; + void *class_region_start; struct slab_metadata *slab_info; + struct libdivide_u32_t size_divisor; + struct libdivide_u64_t slab_size_divisor; // slabs with at least one allocated slot and at least one free slot // @@ -144,8 +147,6 @@ static struct size_class { struct slab_metadata *free_slabs_tail; struct slab_metadata *free_slabs_quarantine[FREE_SLABS_QUARANTINE_RANDOM_SIZE]; - struct libdivide_u32_t size_divisor; - struct libdivide_u64_t slab_size_divisor; struct random_state rng; size_t metadata_allocated; size_t metadata_count;