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

Function pb_init

internal/cbm/sqlite_writer.c:454–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452} PageBuilder;
453
454static void pb_init(PageBuilder *pb, FILE *fp, uint32_t start_page, bool is_index) {
455 pb->fp = fp;
456 pb->next_page = start_page;
457 pb->is_index = is_index;
458 pb->cell_count = 0;
459 pb->content_offset = CBM_PAGE_SIZE;
460 pb->page1_offset = (start_page == SKIP_ONE) ? SQLITE_HEADER_SIZE : 0;
461 // Header: flag(1) + freeblock(2) + cell_count(2) + content_start(2) + fragmented(1) = 8
462 pb->ptr_offset = pb->page1_offset + BTREE_HEADER_SIZE;
463 memset(pb->page, 0, CBM_PAGE_SIZE);
464 pb->leaves = NULL;
465 pb->leaf_count = 0;
466 pb->leaf_cap = 0;
467}
468
469static void pb_free(PageBuilder *pb) {
470 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