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

Function ckh_insert

deps/jemalloc/src/ckh.c:466–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466bool
467ckh_insert(tsd_t *tsd, ckh_t *ckh, const void *key, const void *data) {
468 bool ret;
469
470 assert(ckh != NULL);
471 assert(ckh_search(ckh, key, NULL, NULL));
472
473#ifdef CKH_COUNT
474 ckh->ninserts++;
475#endif
476
477 while (ckh_try_insert(ckh, &key, &data)) {
478 if (ckh_grow(tsd, ckh)) {
479 ret = true;
480 goto label_return;
481 }
482 }
483
484 ret = false;
485label_return:
486 return ret;
487}
488
489bool
490ckh_remove(tsd_t *tsd, ckh_t *ckh, const void *searchkey, void **key,

Callers 5

prof_log_bt_indexFunction · 0.70
prof_log_thr_indexFunction · 0.70
prof_lookup_globalFunction · 0.70
prof_lookupFunction · 0.70
TEST_BEGINFunction · 0.50

Calls 3

ckh_searchFunction · 0.70
ckh_try_insertFunction · 0.70
ckh_growFunction · 0.70

Tested by 1

TEST_BEGINFunction · 0.40