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

Function ckh_iter

deps/jemalloc/src/ckh.c:445–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445bool
446ckh_iter(ckh_t *ckh, size_t *tabind, void **key, void **data) {
447 size_t i, ncells;
448
449 for (i = *tabind, ncells = (ZU(1) << (ckh->lg_curbuckets +
450 LG_CKH_BUCKET_CELLS)); i < ncells; i++) {
451 if (ckh->tab[i].key != NULL) {
452 if (key != NULL) {
453 *key = (void *)ckh->tab[i].key;
454 }
455 if (data != NULL) {
456 *data = (void *)ckh->tab[i].data;
457 }
458 *tabind = i + 1;
459 return false;
460 }
461 }
462
463 return true;
464}
465
466bool
467ckh_insert(tsd_t *tsd, ckh_t *ckh, const void *key, const void *data) {

Callers 3

prof_tdata_merge_iterFunction · 0.70
prof_dump_prepFunction · 0.70
TEST_BEGINFunction · 0.50

Calls

no outgoing calls

Tested by 1

TEST_BEGINFunction · 0.40