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

Function rec_add_blob

internal/cbm/sqlite_writer.c:399–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397}
398
399static void rec_add_blob(RecordBuilder *r, const uint8_t *data, int len) {
400 int64_t st = len > 0 ? ((int64_t)len * BLOB_SERIAL_MUL) + BLOB_SERIAL_BASE : 0;
401 uint8_t vbuf[VARINT_MAX_BYTES];
402 int vlen = put_varint(vbuf, st);
403 dynbuf_append(&r->header, vbuf, vlen);
404 if (len > 0 && data) {
405 dynbuf_append(&r->body, data, len);
406 }
407}
408
409// Finalize: returns the complete record bytes (header_len + header + body).
410// Caller must free the returned buffer.

Callers 2

build_vector_recordFunction · 0.85
build_token_vec_recordFunction · 0.85

Calls 2

put_varintFunction · 0.85
dynbuf_appendFunction · 0.85

Tested by

no test coverage detected