MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / dictRehashSomeAsync

Function dictRehashSomeAsync

src/dict.cpp:461–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459}
460
461bool 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
476void discontinueAsyncRehash(dict *d) {

Callers 2

hash_spin_workerFunction · 0.85
databasesCronFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected