mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 10:08:20 +00:00
![]() Coalesce adjacent free blocks during `page_free_array()` in `core/storage/btree`. Instead of immediately passing free cells to `free_cell_range()`, buffer up to 10 free cells and try to merge adjacent free blocks. Break on the first merge to avoid time complexity, `free_cell_range()` coalesces blocks afterwards anyways. This follows SQLite's [`pageFreeArray()`](htt ps://github.com/sqlite/sqlite/blob/d7324103b196c572a98724a5658970b4000b8 c39/src/btree.c#L7729) implementation. Removed this TODO: ```rust fn page_free_array( . . ) . . // TODO: implement fancy smart free block coalescing procedure instead of dumb free to // then defragment ``` Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #1448 |
||
---|---|---|
.. | ||
btree.rs | ||
buffer_pool.rs | ||
database.rs | ||
mod.rs | ||
page_cache.rs | ||
pager.rs | ||
sqlite3_ondisk.rs | ||
wal.rs |