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

Function edge_key_hash

src/graph_buffer/graph_buffer.c:237–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235 * kept under 1/2. Values are the edge pointers (stable heap records). */
236
237static void edge_key_hash(const char *key, uint64_t *h0, uint64_t *h1) {
238 uint64_t a = 1469598103934665603ULL;
239 uint64_t b = 0x9E3779B97F4A7C15ULL;
240 for (const unsigned char *p = (const unsigned char *)key; *p; p++) {
241 a ^= *p;
242 a *= 1099511628211ULL;
243 b = (b ^ *p) * 0xFF51AFD7ED558CCDULL;
244 b ^= b >> 29;
245 }
246 *h0 = a;
247 *h1 = b ^ (a >> 17);
248}
249
250static void edge_key_map_free(edge_key_map_t *m) {
251 cbm_free(CBM_MEM_CLASS_GBUF_INDEX, m->slots);

Callers 3

unindex_edgeFunction · 0.85
cbm_gbuf_insert_edgeFunction · 0.85
gbuf_delete_edges_ifFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected