38 #ifndef included_qhash_h 39 #define included_qhash_h 83 #define QHASH_LOG2_KEYS_PER_BUCKET 2 84 #define QHASH_KEYS_PER_BUCKET (1 << QHASH_LOG2_KEYS_PER_BUCKET) 105 #define qhash_resize(v,n) (v) = _qhash_resize ((v), (n), sizeof ((v)[0])) 107 #define qhash_foreach(var,v,body) 109 #define qhash_set_multiple(v,keys,n,results) \ 110 (v) = _qhash_set_multiple ((v), sizeof ((v)[0]), (keys), (n), (results)) 112 #define qhash_unset_multiple(v,keys,n,results) \ 113 _qhash_unset_multiple ((v), sizeof ((v)[0]), (keys), (n), (results)) 115 #define qhash_get(v,key) \ 117 uword _qhash_get_k = (key); \ 118 qhash_get_first_match ((v), &_qhash_get_k, 1, &_qhash_get_k); \ 121 #define qhash_set(v,k) \ 123 uword _qhash_set_k = (k); \ 124 qhash_set_multiple ((v), &_qhash_set_k, 1, &_qhash_set_k); \ 128 #define qhash_unset(v,k) \ 130 uword _qhash_unset_k = (k); \ 131 qhash_unset_multiple ((v), &_qhash_unset_k, 1, &_qhash_unset_k); \ 135 void *_qhash_resize (
void *v,
uword length,
uword elt_bytes);
141 uword n_search_keys,
u32 * result_indices);
151 void *_qhash_set_multiple (
void *v,
154 uword n_search_keys,
u32 * result_indices);
156 _qhash_unset_multiple (
void *v,
159 uword n_search_keys,
u32 * result_indices);
static uword qhash_n_overflow(void *v)
static qhash_t * qhash_header(void *v)
static uword pow2_mask(uword x)
static uword qhash_hash_mix(qhash_t *h, uword key)
#define hash_mix32(a0, b0, c0)
u32 qhash_get_first_match(void *v, uword *search_keys, uword n_search_keys, uword *matching_key)
static uword hash_elts(void *v)
static uword qhash_elts(void *v)
static void * vec_header(void *v, uword header_bytes)
Find a user vector header.
u32 * overflow_free_indices
u8 * hash_key_valid_bitmap
void qhash_get_multiple(void *v, uword *search_keys, uword n_search_keys, u32 *result_indices)