better fixme comments

This commit is contained in:
jussisaurio
2024-12-23 21:15:44 +02:00
parent c417fe7880
commit 40a0bef0dc
2 changed files with 7 additions and 2 deletions

View File

@@ -795,9 +795,12 @@ impl BTreeCursor {
// if we clear space that is at the start of the cell content area,
// we need to update the cell content area pointer forward to account for the removed space
// FIXME: is offset ever < cell_content_area?
// FIXME: is offset ever < cell_content_area? cell content area grows leftwards and the pointer
// is to the start of the last allocated cell. should we assert!(offset >= page.cell_content_area())
// and change this to if offset == page.cell_content_area()?
if offset <= page.cell_content_area() {
page.write_u16(PAGE_HEADER_OFFSET_FREEBLOCK, page.first_freeblock()); // why is this here?
// FIXME: remove the line directly below this, it does not change anything.
page.write_u16(PAGE_HEADER_OFFSET_FREEBLOCK, page.first_freeblock());
page.write_u16(PAGE_HEADER_OFFSET_CELL_CONTENT_AREA, offset + len);
return;
}

View File

@@ -484,6 +484,8 @@ impl PageContent {
}
/// The start of the cell content area.
/// SQLite strives to place cells as far toward the end of the b-tree page as it can,
/// in order to leave space for future growth of the cell pointer array.
pub fn cell_content_area(&self) -> u16 {
self.read_u16(5)
}