reorder size_class struct for better performance

This commit is contained in:
Daniel Micay 2018-08-27 05:16:47 -04:00
parent b424c95737
commit 63b0c39343

View File

@ -181,14 +181,14 @@ static size_t get_slab_size(size_t slots, size_t size) {
} }
static struct size_class { static struct size_class {
pthread_mutex_t mutex;
void *class_region_start; void *class_region_start;
size_t metadata_allocated; struct slab_metadata *slab_info;
size_t metadata_count;
struct slab_metadata *partial_slabs; struct slab_metadata *partial_slabs;
struct slab_metadata *free_slabs; struct slab_metadata *free_slabs;
struct slab_metadata *slab_info;
pthread_mutex_t mutex;
struct random_state rng; struct random_state rng;
size_t metadata_allocated;
size_t metadata_count;
} size_class_metadata[N_SIZE_CLASSES]; } size_class_metadata[N_SIZE_CLASSES];
static const size_t class_region_size = 128ULL * 1024 * 1024 * 1024; static const size_t class_region_size = 128ULL * 1024 * 1024 * 1024;