Skip to main content

read_freelist

Function read_freelist 

Source
pub fn read_freelist(pager: &Pager, head: u32) -> Result<(Vec<u32>, Vec<u32>)>
Expand description

Walks the freelist chain rooted at head and returns every free leaf-page ID. The trunk pages themselves are not included — they’re live metadata. Returns the trunk page numbers separately so the caller can release them (the next save re-encodes the freelist from scratch and frees the old trunks for reuse).

head == 0 → empty freelist; returns (vec![], vec![]).