| 459 | } |
| 460 | |
| 461 | bool dictRehashSomeAsync(dictAsyncRehashCtl *ctl, size_t hashes) { |
| 462 | if (ctl->abondon.load(std::memory_order_acquire)) { |
| 463 | ctl->hashIdx = ctl->queue.size(); |
| 464 | } |
| 465 | size_t max = std::min(ctl->hashIdx + hashes, ctl->queue.size()); |
| 466 | for (; ctl->hashIdx < max; ++ctl->hashIdx) { |
| 467 | auto &wi = ctl->queue[ctl->hashIdx]; |
| 468 | wi.hash = dictHashKey(ctl->dict, dictGetKey(wi.de)); |
| 469 | } |
| 470 | |
| 471 | if (ctl->hashIdx == ctl->queue.size()) ctl->done = true; |
| 472 | return ctl->hashIdx < ctl->queue.size(); |
| 473 | } |
| 474 | |
| 475 | |
| 476 | void discontinueAsyncRehash(dict *d) { |
no test coverage detected