Lines Matching refs:k

13 static size_t hash_fn(const void *k, void *ctx)  in hash_fn()  argument
15 return (long)k; in hash_fn()
55 const void *oldk, *k = (const void *)(long)i; in test_hashmap_generic() local
58 err = hashmap__update(map, k, v, &oldk, &oldv); in test_hashmap_generic()
64 err = hashmap__add(map, k, v); in test_hashmap_generic()
66 err = hashmap__set(map, k, v, &oldk, &oldv); in test_hashmap_generic()
73 (long)k, (long)v, err)) in test_hashmap_generic()
76 if (CHECK(!hashmap__find(map, k, &oldv), "elem_find", in test_hashmap_generic()
77 "failed to find key %ld\n", (long)k)) in test_hashmap_generic()
94 long k = (long)entry->key; in test_hashmap_generic() local
97 found_msk |= 1ULL << k; in test_hashmap_generic()
98 if (CHECK(v - k != 1024, "check_kv", in test_hashmap_generic()
99 "invalid k/v pair: %ld = %ld\n", k, v)) in test_hashmap_generic()
107 const void *oldk, *k = (const void *)(long)i; in test_hashmap_generic() local
110 err = hashmap__add(map, k, v); in test_hashmap_generic()
116 err = hashmap__update(map, k, v, &oldk, &oldv); in test_hashmap_generic()
118 err = hashmap__set(map, k, v, &oldk, &oldv); in test_hashmap_generic()
122 (long)k, (long)v, err)) in test_hashmap_generic()
124 if (CHECK(!hashmap__find(map, k, &oldv), "elem_find", in test_hashmap_generic()
125 "failed to find key %ld\n", (long)k)) in test_hashmap_generic()
142 long k = (long)entry->key; in test_hashmap_generic() local
145 found_msk |= 1ULL << k; in test_hashmap_generic()
146 if (CHECK(v - k != 256, "elem_check", in test_hashmap_generic()
147 "invalid updated k/v pair: %ld = %ld\n", k, v)) in test_hashmap_generic()
165 const void *oldk, *k; in test_hashmap_generic() local
168 k = entry->key; in test_hashmap_generic()
172 found_msk |= 1ULL << (long)k; in test_hashmap_generic()
174 if (CHECK(!hashmap__delete(map, k, &oldk, &oldv), "elem_del", in test_hashmap_generic()
176 (long)k, (long)v)) in test_hashmap_generic()
178 if (CHECK(oldk != k || oldv != v, "check_old", in test_hashmap_generic()
180 (long)k, (long)v, (long)oldk, (long)oldv)) in test_hashmap_generic()
182 if (CHECK(hashmap__delete(map, k, &oldk, &oldv), "elem_del", in test_hashmap_generic()
201 const void *oldk, *k; in test_hashmap_generic() local
204 k = entry->key; in test_hashmap_generic()
208 found_msk |= 1ULL << (long)k; in test_hashmap_generic()
210 if (CHECK(!hashmap__delete(map, k, &oldk, &oldv), "elem_del", in test_hashmap_generic()
212 (long)k, (long)v)) in test_hashmap_generic()
214 if (CHECK(oldk != k || oldv != v, "elem_check", in test_hashmap_generic()
216 (long)k, (long)v, (long)oldk, (long)oldv)) in test_hashmap_generic()
218 if (CHECK(hashmap__delete(map, k, &oldk, &oldv), "elem_del", in test_hashmap_generic()
220 (long)k, (long)v)) in test_hashmap_generic()
254 static size_t collision_hash_fn(const void *k, void *ctx) in collision_hash_fn() argument
336 void *k = (void *)0; in test_hashmap_empty() local
349 if (CHECK(hashmap__find(map, k, NULL), "elem_find", in test_hashmap_empty()
352 if (CHECK(hashmap__delete(map, k, NULL, NULL), "elem_del", in test_hashmap_empty()
360 hashmap__for_each_key_entry(map, entry, k) { in test_hashmap_empty()