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

Function pb_add_cell

internal/cbm/sqlite_writer.c:536–545  ·  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

534// For table leaves: varint(payload_len) + varint(rowid) + payload
535// For index leaves: varint(payload_len) + payload
536static void pb_add_cell(PageBuilder *pb, const uint8_t *cell, int cell_len) {
537 // Write cell content (grows down)
538 pb->content_offset -= cell_len;
539 memcpy(pb->page + pb->content_offset, cell, cell_len);
540
541 // Write cell pointer (grows up)
542 put_u16(pb->page + pb->ptr_offset, (uint16_t)pb->content_offset);
543 pb->ptr_offset += CELL_PTR_SIZE;
544 pb->cell_count++;
545}
546
547// Build interior pages from child page references.
548// Returns the root page number.

Callers 2

write_index_btreeFunction · 0.85

Calls 1

put_u16Function · 0.85

Tested by

no test coverage detected