This function performs just a step of rehashing, and only if hashing has * not been paused for our hash table. When we have iterators in the * middle of a rehashing we can't mess with the two hash tables otherwise * some element can be missed or duplicated. * * This function is called by common lookup or update operations in the * dictionary so that the hash table automatically migrates from
| 597 | * dictionary so that the hash table automatically migrates from H1 to H2 |
| 598 | * while it is actively used. */ |
| 599 | static void _dictRehashStep(dict *d) { |
| 600 | int16_t pauserehash; |
| 601 | __atomic_load(&d->pauserehash, &pauserehash, __ATOMIC_RELAXED); |
| 602 | if (pauserehash == 0) dictRehash(d,1); |
| 603 | } |
| 604 | |
| 605 | /* Add an element to the target hash table */ |
| 606 | int dictAdd(dict *d, void *key, void *val, dictEntry **existing) |
no test coverage detected