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

Function cbm_gbuf_new

src/graph_buffer/graph_buffer.c:440–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438/* ── Lifecycle ──────────────────────────────────────────────────── */
439
440cbm_gbuf_t *cbm_gbuf_new(const char *project, const char *root_path) {
441 cbm_gbuf_t *gb = calloc(CBM_ALLOC_ONE, sizeof(cbm_gbuf_t));
442 if (!gb) {
443 return NULL;
444 }
445
446 gb->project = strdup(project ? project : "");
447 gb->root_path = strdup(root_path ? root_path : "");
448 gb->next_id = SKIP_ONE;
449 gb->shared_ids = NULL;
450
451 gb->node_by_qn = cbm_ht_create(CBM_SZ_256);
452 gb->by_id = NULL;
453 gb->by_id_cap = 0;
454 gb->nodes_by_label = cbm_ht_create(CBM_SZ_32);
455 gb->nodes_by_name = cbm_ht_create(CBM_SZ_256);
456
457 gb->edge_by_key = cbm_ht_create(CBM_SZ_512);
458 gb->edges_by_source_type = cbm_ht_create(CBM_SZ_256);
459 gb->edges_by_target_type = cbm_ht_create(CBM_SZ_256);
460 gb->edges_by_type = cbm_ht_create(CBM_SZ_32);
461
462 gb->intern_pool = cbm_ht_create(CBM_SZ_1K);
463
464 return gb;
465}
466
467cbm_gbuf_t *cbm_gbuf_new_shared_ids(const char *project, const char *root_path,
468 _Atomic int64_t *id_source) {

Callers 15

cbm_gbuf_new_shared_idsFunction · 0.85
closure_probe_surfacesFunction · 0.85
run_closure_deltaFunction · 0.85
cbm_pipeline_run_stagedFunction · 0.85
test_simhash.cFile · 0.85
test_mem.cFile · 0.85
test_pipeline.cFile · 0.85
test_configlink.cFile · 0.85
build_oversized_corpusFunction · 0.85
run_sequentialFunction · 0.85

Calls 1

cbm_ht_createFunction · 0.85