free no longer used pages after balance

This commit is contained in:
Pere Diaz Bou
2025-04-09 11:05:41 +02:00
parent edc3a420fb
commit f1df09ffd9

View File

@@ -2045,7 +2045,11 @@ impl BTreeCursor {
rightmost_pointer,
);
// TODO: balance root
// TODO: free pages
// We have to free pages that are not used anymore
for i in sibling_count_new..balance_info.sibling_count {
let page = &balance_info.pages_to_balance[i];
self.pager.free_page(Some(page.clone()), page.get().id)?;
}
(WriteState::BalanceStart, Ok(CursorResult::Ok(())))
}
WriteState::Finish => todo!(),