Browse Source
[Minor] Add utility macros for static hash tables
pull/4517/head
Vsevolod Stakhov
3 years ago
No known key found for this signature in database
GPG Key ID: 7647B6790081437
1 changed files with
2 additions and
0 deletions
-
contrib/libucl/khash.h
|
|
|
@ -467,6 +467,7 @@ static kh_inline khint_t __ac_Wang_hash(khint_t key) |
|
|
|
@return Pointer to the hash table [khash_t(name)*] |
|
|
|
*/ |
|
|
|
#define kh_init(name) kh_init_##name() |
|
|
|
#define kh_static_init(name, h) kh_static_init_##name(h) |
|
|
|
|
|
|
|
/*! @function |
|
|
|
@abstract Destroy a hash table. |
|
|
|
@ -474,6 +475,7 @@ static kh_inline khint_t __ac_Wang_hash(khint_t key) |
|
|
|
@param h Pointer to the hash table [khash_t(name)*] |
|
|
|
*/ |
|
|
|
#define kh_destroy(name, h) kh_destroy_##name(h) |
|
|
|
#define kh_static_destroy(name, h) kh_static_destroy_##name(h) |
|
|
|
|
|
|
|
/*! @function |
|
|
|
@abstract Reset a hash table without deallocating memory. |
|
|
|
|