diff options
| author | Tylo <[email protected]> | 2020-06-20 20:47:56 +0200 |
|---|---|---|
| committer | Tylo <[email protected]> | 2020-06-20 20:47:56 +0200 |
| commit | 173d32f0eb194b30b40fb5eb6e708bc3c4f8f421 (patch) | |
| tree | d8b5da2247b557dc7a1def7bcfc5edcbe6cd4224 /benchmark.c | |
| parent | 2c1382a7cefea370a321ba00e83bcf29df48e5fd (diff) | |
| download | STC-modified-173d32f0eb194b30b40fb5eb6e708bc3c4f8f421.tar.gz STC-modified-173d32f0eb194b30b40fb5eb6e708bc3c4f8f421.zip | |
Renamed CMap to CHash, to reflect that it now supports both (unordered) Map and Set. Second arg in declare_CHash() should be 'set' or 'map'.
Refactored copt.h to be more consistent with other types.
Added cvector_make(size, fillvalue) constructor.
Diffstat (limited to 'benchmark.c')
| -rw-r--r-- | benchmark.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/benchmark.c b/benchmark.c index 8b6a49c8..72e47699 100644 --- a/benchmark.c +++ b/benchmark.c @@ -19,7 +19,7 @@ static inline uint32_t fibonacci_hash(const void* data, size_t len) { const uint64_t key = *(const uint64_t *) data;
return (uint32_t) (key * 11400714819323198485llu);
}
-declare_CMap(ii, int64_t, int64_t, c_noDestroy, fibonacci_hash); // c_lowbias32Hash);
+declare_CHash(ii, map, int64_t, int64_t, c_emptyDestroy, fibonacci_hash); // c_lowbias32Hash);
KHASH_MAP_INIT_INT64(ii, uint64_t)
@@ -34,14 +34,14 @@ sfc64_t rng; //#define RAND(N) (mt19937_rand(&rng) & ((1 << N) - 1))
-#define CMAP_SETUP(tag, Key, Value) CMap_##tag map = cmap_init; \
- cmap_##tag##_setMaxLoadFactor(&map, maxLoadFactor)
-#define CMAP_PUT(tag, key, val) cmap_##tag##_put(&map, key, val)->value
-#define CMAP_ERASE(tag, key) cmap_##tag##_erase(&map, key)
-#define CMAP_FIND(tag, key) (cmap_##tag##_get(map, key) != NULL)
-#define CMAP_SIZE(tag) cmap_size(map)
-#define CMAP_BUCKETS(tag) cmap_bucketCount(map)
-#define CMAP_CLEAR(tag) cmap_##tag##_destroy(&map)
+#define CMAP_SETUP(tag, Key, Value) CHash_##tag map = chash_init; \
+ chash_##tag##_setMaxLoadFactor(&map, maxLoadFactor)
+#define CMAP_PUT(tag, key, val) chash_##tag##_put(&map, key, val)->value
+#define CMAP_ERASE(tag, key) chash_##tag##_erase(&map, key)
+#define CMAP_FIND(tag, key) (chash_##tag##_get(map, key) != NULL)
+#define CMAP_SIZE(tag) chash_size(map)
+#define CMAP_BUCKETS(tag) chash_bucketCount(map)
+#define CMAP_CLEAR(tag) chash_##tag##_destroy(&map)
#define KMAP_SETUP(tag, Key, Value) khash_t(ii)* map = kh_init(ii); khiter_t ki; int ret
#define KMAP_PUT(tag, key, val) (*(ki = kh_put(ii, map, key, &ret), map->vals[ki] = val, &map->vals[ki]))
|
