MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_ht_create

Function cbm_ht_create

src/foundation/hash_table.c:44–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42};
43
44CBMHashTable *cbm_ht_create(uint32_t initial_capacity) {
45 CBMHashTable *ht = (CBMHashTable *)calloc(CBM_ALLOC_ONE, sizeof(*ht));
46 if (!ht)
47 return NULL;
48 cbm_vt_init(&ht->vt);
49 if (initial_capacity > 0) {
50 /* Reserve enough buckets for the requested entries. Verstable
51 * computes the minimum bucket count internally. */
52 if (!cbm_vt_reserve(&ht->vt, (size_t)initial_capacity)) {
53 cbm_vt_cleanup(&ht->vt);
54 free(ht);
55 return NULL;
56 }
57 }
58 return ht;
59}
60
61void cbm_ht_free(CBMHashTable *ht) {
62 if (!ht)

Callers 15

cbm_quarantine_loadFunction · 0.85
ensure_pretrained_mapFunction · 0.85
cbm_sem_corpus_newFunction · 0.85
cbm_gbuf_newFunction · 0.85
cbm_gbuf_delete_by_labelFunction · 0.85
cbm_gbuf_delete_by_fileFunction · 0.85
merge_update_existingFunction · 0.85
cbm_watcher_newFunction · 0.85
cbm_pkgmap_buildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected