Home
last modified time | relevance | path

Searched refs:hash_fn (Results 1 – 4 of 4) sorted by relevance

/tools/lib/bpf/
Dhashmap.h36 hashmap_hash_fn hash_fn; member
46 #define HASHMAP_INIT(hash_fn, equal_fn, ctx) { \ argument
47 .hash_fn = (hash_fn), \
56 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn,
58 struct hashmap *hashmap__new(hashmap_hash_fn hash_fn,
163 for (cur = ({ size_t bkt = hash_bits(map->hash_fn((_key), map->ctx),\
171 for (cur = ({ size_t bkt = hash_bits(map->hash_fn((_key), map->ctx),\
Dhashmap.c32 void hashmap__init(struct hashmap *map, hashmap_hash_fn hash_fn, in hashmap__init() argument
35 map->hash_fn = hash_fn; in hashmap__init()
45 struct hashmap *hashmap__new(hashmap_hash_fn hash_fn, in hashmap__new() argument
53 hashmap__init(map, hash_fn, equal_fn, ctx); in hashmap__new()
113 h = hash_bits(map->hash_fn(cur->key, map->ctx), new_cap_bits); in hashmap_grow()
162 h = hash_bits(map->hash_fn(key, map->ctx), map->cap_bits); in hashmap__insert()
186 h = hash_bits(map->hash_fn(key, map->ctx), map->cap_bits); in hashmap__insert()
206 h = hash_bits(map->hash_fn(key, map->ctx), map->cap_bits); in hashmap__find()
221 h = hash_bits(map->hash_fn(key, map->ctx), map->cap_bits); in hashmap__delete()
Dbtf.c1385 hashmap_hash_fn hash_fn = btf_dedup_identity_hash_fn; in btf_dedup_new() local
1394 hash_fn = btf_dedup_collision_hash_fn; in btf_dedup_new()
1399 d->dedup_table = hashmap__new(hash_fn, btf_dedup_equal_fn, NULL); in btf_dedup_new()
/tools/testing/selftests/bpf/
Dtest_hashmap.c22 size_t hash_fn(const void *k, void *ctx) in hash_fn() function
61 map = hashmap__new(hash_fn, equal_fn, NULL); in test_hashmap_generic()
342 map = hashmap__new(hash_fn, equal_fn, NULL); in test_hashmap_empty()