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

Function alloc_next_id

src/graph_buffer/graph_buffer.c:264–269  ·  view source on GitHub ↗

Allocate the next buffer-local or shared-atomic ID. */

Source from the content-addressed store, hash-verified

262
263/* Allocate the next buffer-local or shared-atomic ID. */
264static int64_t alloc_next_id(cbm_gbuf_t *gb) {
265 if (gb->shared_ids) {
266 return atomic_fetch_add_explicit(gb->shared_ids, SKIP_ONE, memory_order_relaxed);
267 }
268 return gb->next_id++;
269}
270
271/* Swap-remove an edge from a pointer array by ID. */
272static void remove_edge_from_ptr_array(edge_ptr_array_t *arr, int64_t edge_id) {

Callers 2

cbm_gbuf_upsert_nodeFunction · 0.85
cbm_gbuf_insert_edgeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected