From 46471ea32760a90ac3b860f96805901c78a34f62 Mon Sep 17 00:00:00 2001 From: David Goldblatt Date: Wed, 15 Apr 2020 14:08:20 -0700 Subject: [PATCH] SC: Name the max lookup constant. --- include/jemalloc/internal/sc.h | 5 +++-- src/sc.c | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/jemalloc/internal/sc.h b/include/jemalloc/internal/sc.h index 6bc5db37..138da5c0 100644 --- a/include/jemalloc/internal/sc.h +++ b/include/jemalloc/internal/sc.h @@ -246,8 +246,9 @@ # error "Too many small size classes" #endif -/* The largest size class in the lookup table. */ -#define SC_LOOKUP_MAXCLASS ((size_t)1 << 12) +/* The largest size class in the lookup table, and its binary log. */ +#define SC_LG_MAX_LOOKUP 12 +#define SC_LOOKUP_MAXCLASS ((size_t)1 << SC_LG_MAX_LOOKUP) /* Internal, only used for the definition of SC_SMALL_MAXCLASS. */ #define SC_SMALL_MAX_BASE ((size_t)1 << (LG_PAGE + SC_LG_NGROUP - 1)) diff --git a/src/sc.c b/src/sc.c index cfce533f..1474eacc 100644 --- a/src/sc.c +++ b/src/sc.c @@ -259,10 +259,8 @@ void sc_data_init(sc_data_t *sc_data) { assert(!sc_data->initialized); - int lg_max_lookup = 12; - size_classes(sc_data, LG_SIZEOF_PTR, LG_QUANTUM, SC_LG_TINY_MIN, - lg_max_lookup, LG_PAGE, SC_LG_NGROUP); + SC_LG_MAX_LOOKUP, LG_PAGE, SC_LG_NGROUP); sc_data->initialized = true; }