Lines Matching refs:k

22 size_t hash_fn(const void *k, void *ctx)  in hash_fn()  argument
24 return (long)k; in hash_fn()
66 const void *oldk, *k = (const void *)(long)i; in test_hashmap_generic() local
69 err = hashmap__update(map, k, v, &oldk, &oldv); in test_hashmap_generic()
74 err = hashmap__add(map, k, v); in test_hashmap_generic()
76 err = hashmap__set(map, k, v, &oldk, &oldv); in test_hashmap_generic()
83 (long)k, (long)v, err)) in test_hashmap_generic()
86 if (CHECK(!hashmap__find(map, k, &oldv), in test_hashmap_generic()
87 "failed to find key %ld\n", (long)k)) in test_hashmap_generic()
102 long k = (long)entry->key; in test_hashmap_generic() local
105 found_msk |= 1ULL << k; in test_hashmap_generic()
106 if (CHECK(v - k != 1024, "invalid k/v pair: %ld = %ld\n", k, v)) in test_hashmap_generic()
114 const void *oldk, *k = (const void *)(long)i; in test_hashmap_generic() local
117 err = hashmap__add(map, k, v); in test_hashmap_generic()
122 err = hashmap__update(map, k, v, &oldk, &oldv); in test_hashmap_generic()
124 err = hashmap__set(map, k, v, &oldk, &oldv); in test_hashmap_generic()
127 (long)k, (long)v, err)) in test_hashmap_generic()
129 if (CHECK(!hashmap__find(map, k, &oldv), in test_hashmap_generic()
130 "failed to find key %ld\n", (long)k)) in test_hashmap_generic()
145 long k = (long)entry->key; in test_hashmap_generic() local
148 found_msk |= 1ULL << k; in test_hashmap_generic()
149 if (CHECK(v - k != 256, in test_hashmap_generic()
150 "invalid updated k/v pair: %ld = %ld\n", k, v)) in test_hashmap_generic()
167 const void *oldk, *k; in test_hashmap_generic() local
170 k = entry->key; in test_hashmap_generic()
174 found_msk |= 1ULL << (long)k; in test_hashmap_generic()
176 if (CHECK(!hashmap__delete(map, k, &oldk, &oldv), in test_hashmap_generic()
178 (long)k, (long)v)) in test_hashmap_generic()
180 if (CHECK(oldk != k || oldv != v, in test_hashmap_generic()
182 (long)k, (long)v, (long)oldk, (long)oldv)) in test_hashmap_generic()
184 if (CHECK(hashmap__delete(map, k, &oldk, &oldv), in test_hashmap_generic()
202 const void *oldk, *k; in test_hashmap_generic() local
205 k = entry->key; in test_hashmap_generic()
209 found_msk |= 1ULL << (long)k; in test_hashmap_generic()
211 if (CHECK(!hashmap__delete(map, k, &oldk, &oldv), in test_hashmap_generic()
213 (long)k, (long)v)) in test_hashmap_generic()
215 if (CHECK(oldk != k || oldv != v, in test_hashmap_generic()
217 (long)k, (long)v, (long)oldk, (long)oldv)) in test_hashmap_generic()
219 if (CHECK(hashmap__delete(map, k, &oldk, &oldv), in test_hashmap_generic()
221 (long)k, (long)v)) in test_hashmap_generic()
252 size_t collision_hash_fn(const void *k, void *ctx) in collision_hash_fn() argument
337 void *k = (void *)0; in test_hashmap_empty() local
352 if (CHECK(hashmap__find(map, k, NULL), "unexpected find\n")) in test_hashmap_empty()
354 if (CHECK(hashmap__delete(map, k, NULL, NULL), "unexpected delete\n")) in test_hashmap_empty()
361 hashmap__for_each_key_entry(map, entry, k) { in test_hashmap_empty()