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

Function cr_blob

internal/cbm/result_compact.c:154–174  ·  view source on GitHub ↗

A blob (fingerprint, retained source): copied verbatim. */

Source from the content-addressed store, hash-verified

152
153/* A blob (fingerprint, retained source): copied verbatim. */
154static void cr_blob(cr_ctx_t *c, const void **field, size_t bytes) {
155 if (!*field || bytes == 0) {
156 return;
157 }
158 if (c->phase == CR_RELOCATE) {
159 if (cr_in_old_block(c, *field)) {
160 *field = (const char *)*field + c->delta;
161 }
162 return;
163 }
164 if (c->phase == CR_COPY) {
165 void *copy = cr_alloc(c, bytes);
166 if (!copy) {
167 return;
168 }
169 memcpy(copy, *field, bytes);
170 *field = copy;
171 } else {
172 (void)cr_alloc(c, bytes);
173 }
174}
175
176/* A record array: copied at exact count, then the caller walks its fields. */
177static void cr_array(cr_ctx_t *c, void **items, int count, size_t elem) {

Callers 5

cr_arrayFunction · 0.85
cr_listFunction · 0.85
cr_counted_listFunction · 0.85
cr_walk_defFunction · 0.85
cr_walkFunction · 0.85

Calls 2

cr_in_old_blockFunction · 0.85
cr_allocFunction · 0.85

Tested by

no test coverage detected