We want to change the common mask: this fixes up the table */
| 224 | |
| 225 | /* We want to change the common mask: this fixes up the table */ |
| 226 | static COLD void fixup_table_common(struct htable *ht, uintptr_t maskdiff) |
| 227 | { |
| 228 | size_t i; |
| 229 | uintptr_t bitsdiff; |
| 230 | |
| 231 | again: |
| 232 | bitsdiff = ht->common_bits & maskdiff; |
| 233 | |
| 234 | for (i = 0; i < (size_t)1 << ht->bits; i++) { |
| 235 | uintptr_t e; |
| 236 | if (!entry_is_valid(e = ht->table[i])) |
| 237 | continue; |
| 238 | |
| 239 | /* Clear the bits no longer in the mask, set them as |
| 240 | * expected. */ |
| 241 | e &= ~maskdiff; |
| 242 | e |= bitsdiff; |
| 243 | /* If this made it invalid, restart with more exposed */ |
| 244 | if (!entry_is_valid(e)) { |
| 245 | unset_another_common_bit(ht, &maskdiff, get_raw_ptr(ht, e)); |
| 246 | goto again; |
| 247 | } |
| 248 | ht->table[i] = e; |
| 249 | } |
| 250 | |
| 251 | /* Take away those bits from our mask, bits and perfect bit. */ |
| 252 | ht->common_mask &= ~maskdiff; |
| 253 | ht->common_bits &= ~maskdiff; |
| 254 | if (ht_perfect_mask(ht) & maskdiff) |
| 255 | ht->perfect_bitnum = NO_PERFECT_BIT; |
| 256 | } |
| 257 | |
| 258 | /* Limited recursion */ |
| 259 | static void ht_add(struct htable *ht, const void *new, size_t h); |
no test coverage detected