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

Function gm_new_entry

src/store/graph_mem.c:443–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

441}
442
443static cbm_graph_mem_t *gm_new_entry(const char *db_path, const char *version, size_t est) {
444 cbm_graph_mem_t *g = cbm_calloc(CBM_MEM_CLASS_GRAPH_CACHE, sizeof(*g));
445 if (!g) {
446 return NULL;
447 }
448 g->path = cbm_mem_strdup(CBM_MEM_CLASS_GRAPH_CACHE, db_path);
449 if (!g->path) {
450 gm_free_ptr(g);
451 return NULL;
452 }
453 memcpy(g->version, version, strlen(version) + 1);
454 g->refs = 1;
455 g->bytes = est;
456 return g;
457}
458
459cbm_graph_mem_t *cbm_graph_mem_acquire(sqlite3 *db, const char *db_path, const char *version) {
460 if (!db || !db_path || !version || !version[0] || strlen(version) >= GM_VERSION_MAX) {

Callers 1

cbm_graph_mem_acquireFunction · 0.85

Calls 3

cbm_callocFunction · 0.85
cbm_mem_strdupFunction · 0.85
gm_free_ptrFunction · 0.85

Tested by

no test coverage detected