This does not expand the hash table, that's up to caller. */
| 288 | |
| 289 | /* This does not expand the hash table, that's up to caller. */ |
| 290 | static void ht_add(struct htable *ht, const void *new, size_t h) |
| 291 | { |
| 292 | size_t i; |
| 293 | uintptr_t perfect = ht_perfect_mask(ht); |
| 294 | |
| 295 | i = hash_bucket(ht, h); |
| 296 | |
| 297 | while (entry_is_valid(ht->table[i])) { |
| 298 | perfect = 0; |
| 299 | i = (i + 1) & ((1 << ht->bits)-1); |
| 300 | } |
| 301 | ht->table[i] = make_hval(ht, new, get_hash_ptr_bits(ht, h)|perfect); |
| 302 | if (!entry_is_valid(ht->table[i])) |
| 303 | update_common_fix_invalid(ht, new, h); |
| 304 | } |
| 305 | |
| 306 | static COLD bool double_table(struct htable *ht) |
| 307 | { |
no test coverage detected