1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:17:44 +00:00

LibSQL: Reuse heap blocks when overwriting storage

Previously, only the first block in a chain of blocks would be
overwritten while all subsequent blocks would be appended to the heap.
Now we make sure to reuse all existing blocks in the chain.
This commit is contained in:
Jelle Raaijmakers 2023-05-24 14:08:31 +02:00 committed by Tim Flynn
parent 2d2911e1a3
commit c5ebc4bb40
3 changed files with 68 additions and 3 deletions

View file

@ -71,6 +71,8 @@ public:
virtual ~Heap() override;
ErrorOr<void> open();
ErrorOr<size_t> file_size_in_bytes() const;
bool has_block(Block::Index) const;
[[nodiscard]] Block::Index request_new_block_index() { return m_next_block++; }