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

Function gm_estimate

src/store/graph_mem.c:234–238  ·  view source on GitHub ↗

Upper bound of a layer's bytes: edge ids are unique positive rowids, so the * edge count never exceeds max(edges.id). */

Source from the content-addressed store, hash-verified

232/* Upper bound of a layer's bytes: edge ids are unique positive rowids, so the
233 * edge count never exceeds max(edges.id). */
234static size_t gm_estimate(int64_t max_node, int64_t max_edge) {
235 size_t offsets = ((size_t)max_node + 2) * sizeof(uint32_t);
236 size_t per_edge = sizeof(uint32_t) + sizeof(uint8_t);
237 return GM_GROWTH * offsets + GM_GROWTH * (size_t)max_edge * per_edge;
238}
239
240static int gm_intern(cbm_graph_mem_t *g, const unsigned char *text, size_t len, int *last) {
241 if (*last >= 0 && g->type_len[*last] == len && memcmp(g->types[*last], text, len) == 0) {

Callers 1

cbm_graph_mem_acquireFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected