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

Function pb_init

internal/cbm/sqlite_writer.c:546–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544} PageBuilder;
545
546static void pb_init(PageBuilder *pb, FILE *fp, uint32_t start_page, bool is_index) {
547 pb->fp = fp;
548 pb->next_page = start_page;
549 pb->is_index = is_index;
550 pb->cell_count = 0;
551 pb->content_offset = CBM_PAGE_SIZE;
552 pb->page1_offset = (start_page == SKIP_ONE) ? SQLITE_HEADER_SIZE : 0;
553 // Header: flag(1) + freeblock(2) + cell_count(2) + content_start(2) + fragmented(1) = 8
554 pb->ptr_offset = pb->page1_offset + BTREE_HEADER_SIZE;
555 memset(pb->page, 0, CBM_PAGE_SIZE);
556 pb->leaves = NULL;
557 pb->leaf_count = 0;
558 pb->leaf_cap = 0;
559 pb->cell_buf = NULL;
560 pb->cell_cap = 0;
561}
562
563static void pb_free(PageBuilder *pb) {
564 if (pb->leaves) {

Callers 4

write_table_btreeFunction · 0.85
write_index_btreeFunction · 0.85
write_one_tableFunction · 0.85
cbm_writer_openFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected