|
|
@ -151,6 +151,14 @@ typedef unsigned long long khint64_t;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif /* kh_inline */
|
|
|
|
#endif /* kh_inline */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef klib_unused
|
|
|
|
|
|
|
|
#if (defined __clang__ && __clang_major__ >= 3) || (defined __GNUC__ && __GNUC__ >= 3)
|
|
|
|
|
|
|
|
#define klib_unused __attribute__ ((__unused__))
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define klib_unused
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* klib_unused */
|
|
|
|
|
|
|
|
|
|
|
|
typedef khint32_t khint_t;
|
|
|
|
typedef khint32_t khint_t;
|
|
|
|
typedef khint_t khiter_t;
|
|
|
|
typedef khint_t khiter_t;
|
|
|
|
|
|
|
|
|
|
|
@ -184,7 +192,7 @@ typedef khint_t khiter_t;
|
|
|
|
static const double __ac_HASH_UPPER = 0.77;
|
|
|
|
static const double __ac_HASH_UPPER = 0.77;
|
|
|
|
|
|
|
|
|
|
|
|
#define __KHASH_TYPE(name, khkey_t, khval_t) \
|
|
|
|
#define __KHASH_TYPE(name, khkey_t, khval_t) \
|
|
|
|
typedef struct { \
|
|
|
|
typedef struct kh_##name##_s { \
|
|
|
|
khint_t n_buckets, size, n_occupied, upper_bound; \
|
|
|
|
khint_t n_buckets, size, n_occupied, upper_bound; \
|
|
|
|
khint32_t *flags; \
|
|
|
|
khint32_t *flags; \
|
|
|
|
khkey_t *keys; \
|
|
|
|
khkey_t *keys; \
|
|
|
@ -355,7 +363,7 @@ static const double __ac_HASH_UPPER = 0.77;
|
|
|
|
__KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
|
|
|
|
__KHASH_IMPL(name, SCOPE, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
|
|
|
|
|
|
|
|
|
|
|
|
#define KHASH_INIT(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
|
|
|
|
#define KHASH_INIT(name, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal) \
|
|
|
|
KHASH_INIT2(name, static kh_inline, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
|
|
|
|
KHASH_INIT2(name, static kh_inline klib_unused, khkey_t, khval_t, kh_is_map, __hash_func, __hash_equal)
|
|
|
|
|
|
|
|
|
|
|
|
/* --- BEGIN OF HASH FUNCTIONS --- */
|
|
|
|
/* --- BEGIN OF HASH FUNCTIONS --- */
|
|
|
|
|
|
|
|
|
|
|
@ -411,7 +419,7 @@ static kh_inline khint_t __ac_Wang_hash(khint_t key)
|
|
|
|
key ^= (key >> 16);
|
|
|
|
key ^= (key >> 16);
|
|
|
|
return key;
|
|
|
|
return key;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#define kh_int_hash_func2(k) __ac_Wang_hash((khint_t)key)
|
|
|
|
#define kh_int_hash_func2(key) __ac_Wang_hash((khint_t)key)
|
|
|
|
|
|
|
|
|
|
|
|
/* --- END OF HASH FUNCTIONS --- */
|
|
|
|
/* --- END OF HASH FUNCTIONS --- */
|
|
|
|
|
|
|
|
|
|
|
|