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

Function take_entry

src/foundation/mem_events.c:1103–1115  ·  view source on GitHub ↗

Removes the record of `block`. Returns false when the layer never saw it. */

Source from the content-addressed store, hash-verified

1101
1102/* Removes the record of `block`. Returns false when the layer never saw it. */
1103static bool take_entry(uintptr_t block, ptr_entry_t *out) {
1104 shard_t *sh = shard_of(block);
1105 lock_take(&sh->lock);
1106 ptr_entry_t *e = shard_find(sh, block);
1107 bool found = e != NULL;
1108 if (found) {
1109 *out = *e;
1110 e->block = MEMEV_TOMBSTONE;
1111 sh->live--;
1112 }
1113 lock_drop(&sh->lock);
1114 return found;
1115}
1116
1117void cbm_memev_free(void *block) {
1118 if (!block || !cbm_memev_enabled()) {

Callers 2

cbm_memev_freeFunction · 0.85
cbm_memev_reallocFunction · 0.85

Calls 4

shard_ofFunction · 0.85
lock_takeFunction · 0.85
shard_findFunction · 0.85
lock_dropFunction · 0.85

Tested by

no test coverage detected