38 #ifndef included_qhash_h 39 #define included_qhash_h 76 #define QHASH_LOG2_KEYS_PER_BUCKET 2 77 #define QHASH_KEYS_PER_BUCKET (1 << QHASH_LOG2_KEYS_PER_BUCKET) 98 #define qhash_resize(v,n) (v) = _qhash_resize ((v), (n), sizeof ((v)[0])) 101 #define qhash_foreach(var,v,body) 103 #define qhash_set_multiple(v,keys,n,results) \ 104 (v) = _qhash_set_multiple ((v), sizeof ((v)[0]), (keys), (n), (results)) 106 #define qhash_unset_multiple(v,keys,n,results) \ 107 _qhash_unset_multiple ((v), sizeof ((v)[0]), (keys), (n), (results)) 109 #define qhash_get(v,key) \ 111 uword _qhash_get_k = (key); \ 112 qhash_get_first_match ((v), &_qhash_get_k, 1, &_qhash_get_k); \ 115 #define qhash_set(v,k) \ 117 uword _qhash_set_k = (k); \ 118 qhash_set_multiple ((v), &_qhash_set_k, 1, &_qhash_set_k); \ 122 #define qhash_unset(v,k) \ 124 uword _qhash_unset_k = (k); \ 125 qhash_unset_multiple ((v), &_qhash_unset_k, 1, &_qhash_unset_k); \ 130 _qhash_resize (
void * v,
uword length,
uword elt_bytes);
137 u32 * result_indices);
145 uword * matching_key);
149 _qhash_set_multiple (
void * v,
153 u32 * result_indices);
155 _qhash_unset_multiple (
void * v,
159 u32 * result_indices);
always_inline uword qhash_n_overflow(void *v)
always_inline uword qhash_elts(void *v)
always_inline qhash_t * qhash_header(void *v)
#define hash_mix32(a0, b0, c0)
always_inline uword hash_elts(void *v)
u32 qhash_get_first_match(void *v, uword *search_keys, uword n_search_keys, uword *matching_key)
always_inline void * vec_header(void *v, uword header_bytes)
Find a user vector header.
always_inline uword pow2_mask(uword x)
u32 * overflow_free_indices
always_inline uword qhash_hash_mix(qhash_t *h, uword key)
u8 * hash_key_valid_bitmap
void qhash_get_multiple(void *v, uword *search_keys, uword n_search_keys, u32 *result_indices)