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

Function cbm_graph_mem_release

src/store/graph_mem.c:542–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

540}
541
542void cbm_graph_mem_release(cbm_graph_mem_t *g) {
543 if (!g) {
544 return;
545 }
546 uint64_t now = gm_now_ms();
547 sqlite3_mutex *mu = gm_registry_mutex();
548 sqlite3_mutex_enter(mu);
549 g->refs--;
550 if (g->refs == 0) {
551 g->idle_since_ms = now;
552 }
553 if (g->refs == 0 && g->detached) {
554 g_total_bytes -= g->bytes;
555 gm_destroy(g);
556 }
557 sqlite3_mutex_leave(mu);
558}
559
560void cbm_graph_mem_evict_expired(void) {
561 uint64_t now = gm_now_ms();

Callers 2

cbm_store_closeFunction · 0.85
store_graph_memFunction · 0.85

Calls 3

gm_now_msFunction · 0.85
gm_registry_mutexFunction · 0.85
gm_destroyFunction · 0.85

Tested by

no test coverage detected