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

Function cbm_init

internal/cbm/cbm.c:350–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348static int cbm_initialized = 0;
349
350int cbm_init(void) {
351 if (cbm_initialized) {
352 return 0;
353 }
354 enum { CBM_INIT_DONE = 1 };
355 cbm_initialized = CBM_INIT_DONE;
356 /* Defense-in-depth allocator binds (idempotent). main() calls cbm_alloc_init
357 * first; this covers non-main entry points (pipeline passes call cbm_init).
358 * For sqlite the SQLITE_CONFIG_MALLOC bind only takes effect if it runs
359 * before sqlite initializes — main() guarantees that ordering; here it is a
360 * best-effort idempotent re-assert for paths that never hit main(). */
361 cbm_alloc_init();
362 return 0;
363}
364
365void cbm_reset_thread_parser(void) {
366 // Release parser's internal slab-allocated subtrees (stack, cached token).

Calls 1

cbm_alloc_initFunction · 0.85