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

Function pb_add_cell

internal/cbm/sqlite_writer.c:554–563  ·  view source on GitHub ↗

Add a cell to the current leaf page. For table leaves: varint(payload_len) + varint(rowid) + payload For index leaves: varint(payload_len) + payload

Source from the content-addressed store, hash-verified

552// For table leaves: varint(payload_len) + varint(rowid) + payload
553// For index leaves: varint(payload_len) + payload
554static void pb_add_cell(PageBuilder *pb, const uint8_t *cell, int cell_len) {
555 // Write cell content (grows down)
556 pb->content_offset -= cell_len;
557 memcpy(pb->page + pb->content_offset, cell, cell_len);
558
559 // Write cell pointer (grows up)
560 put_u16(pb->page + pb->ptr_offset, (uint16_t)pb->content_offset);
561 pb->ptr_offset += CELL_PTR_SIZE;
562 pb->cell_count++;
563}
564
565// Build interior pages from child page references.
566// Returns the root page number.

Callers 2

write_index_btreeFunction · 0.85

Calls 1

put_u16Function · 0.85

Tested by

no test coverage detected