This does not expand the hash table, that's up to caller. */
| 276 | |
| 277 | /* This does not expand the hash table, that's up to caller. */ |
| 278 | static void ht_add(struct htable *ht, const void *new, size_t h) |
| 279 | { |
| 280 | size_t i; |
| 281 | uintptr_t perfect = ht_perfect_mask(ht); |
| 282 | |
| 283 | i = hash_bucket(ht, h); |
| 284 | |
| 285 | while (entry_is_valid(ht->table[i])) { |
| 286 | perfect = 0; |
| 287 | i = (i + 1) & ((1 << ht->bits)-1); |
| 288 | } |
| 289 | ht->table[i] = make_hval(ht, new, get_hash_ptr_bits(ht, h)|perfect); |
| 290 | if (!entry_is_valid(ht->table[i])) |
| 291 | update_common_fix_invalid(ht, new, h); |
| 292 | } |
| 293 | |
| 294 | static COLD bool double_table(struct htable *ht) |
| 295 | { |
no test coverage detected