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

Function cbm_gbuf_new

src/graph_buffer/graph_buffer.c:436–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 13

cbm_gbuf_new_shared_idsFunction · 0.85
cbm_pipeline_runFunction · 0.85
test_simhash.cFile · 0.85
test_mem.cFile · 0.85
test_pipeline.cFile · 0.85
test_configlink.cFile · 0.85
run_sequentialFunction · 0.85
test_parallel.cFile · 0.85
test_vmem.cFile · 0.85

Calls 1

cbm_ht_createFunction · 0.85

Tested by 2

run_sequentialFunction · 0.68