Skip to content

Commit

Permalink
[Minor] Add utility macros for static hash tables
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Jun 17, 2023
1 parent c477b4b commit dc5d99e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrib/libucl/khash.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,15 @@ 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.
@param name Name of the hash table [symbol]
@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.
Expand Down

0 comments on commit dc5d99e

Please sign in to comment.