From d1d8a9f389155c223db92d060b8fbccda58e2e53 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Thu, 3 Nov 2022 13:28:45 +0100 Subject: Made cmap i_max_load_factor a compile time template parameter instead of runtime. Enables cmap to be NULL initialized. Currently only cvec/cdeq and csmap cannot be NULL initialized, but eventually they will. --- benchmarks/shootout_hashmaps.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'benchmarks/shootout_hashmaps.cpp') diff --git a/benchmarks/shootout_hashmaps.cpp b/benchmarks/shootout_hashmaps.cpp index d662ed60..d29149e2 100644 --- a/benchmarks/shootout_hashmaps.cpp +++ b/benchmarks/shootout_hashmaps.cpp @@ -36,13 +36,13 @@ KHASH_MAP_INIT_INT64(ii, IValue) #define i_val IValue #define i_size uint32_t // optional, enables 2x expand #define i_tag ii +#define i_max_load_factor MAX_LOAD_FACTOR / 100.0f #include #define SEED(s) rng = stc64_new(s) #define RAND(N) (stc64_rand(&rng) & (((uint64_t)1 << N) - 1)) -#define CMAP_SETUP(X, Key, Value) cmap_##X map = cmap_##X##_init(); \ - cmap_##X##_max_load_factor(&map, MAX_LOAD_FACTOR/100.0f) +#define CMAP_SETUP(X, Key, Value) cmap_##X map = cmap_##X##_init() #define CMAP_PUT(X, key, val) cmap_##X##_insert_or_assign(&map, key, val).ref->second #define CMAP_EMPLACE(X, key, val) cmap_##X##_insert(&map, key, val).ref->second #define CMAP_ERASE(X, key) cmap_##X##_erase(&map, key) -- cgit v1.2.3