diff options
| author | Tyge Løvset <[email protected]> | 2022-11-03 13:28:45 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-11-03 13:28:45 +0100 |
| commit | d1d8a9f389155c223db92d060b8fbccda58e2e53 (patch) | |
| tree | 718fac6edbf34056c188fadfec63f9c15514a32c /benchmarks/shootout_hashmaps.cpp | |
| parent | a913e030b5db2e0d0a49234a86fa39930b4ed6e9 (diff) | |
| download | STC-modified-d1d8a9f389155c223db92d060b8fbccda58e2e53.tar.gz STC-modified-d1d8a9f389155c223db92d060b8fbccda58e2e53.zip | |
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.
Diffstat (limited to 'benchmarks/shootout_hashmaps.cpp')
| -rw-r--r-- | benchmarks/shootout_hashmaps.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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 <stc/cmap.h> #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) |
