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

Function pb_init

internal/cbm/sqlite_writer.c:465–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

463} PageBuilder;
464
465static void pb_init(PageBuilder *pb, FILE *fp, uint32_t start_page, bool is_index) {
466 pb->fp = fp;
467 pb->next_page = start_page;
468 pb->is_index = is_index;
469 pb->cell_count = 0;
470 pb->content_offset = CBM_PAGE_SIZE;
471 pb->page1_offset = (start_page == SKIP_ONE) ? SQLITE_HEADER_SIZE : 0;
472 // Header: flag(1) + freeblock(2) + cell_count(2) + content_start(2) + fragmented(1) = 8
473 pb->ptr_offset = pb->page1_offset + BTREE_HEADER_SIZE;
474 memset(pb->page, 0, CBM_PAGE_SIZE);
475 pb->leaves = NULL;
476 pb->leaf_count = 0;
477 pb->leaf_cap = 0;
478}
479
480static void pb_free(PageBuilder *pb) {
481 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