1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

LibSQL: Free heap storage when deleting rows

This commit is contained in:
Jelle Raaijmakers 2023-05-24 15:57:34 +02:00 committed by Tim Flynn
parent c58c87d7ef
commit 69e09fed39
3 changed files with 33 additions and 1 deletions

View file

@ -6,7 +6,6 @@
*/
#include <AK/DeprecatedString.h>
#include <AK/NonnullRefPtr.h>
#include <LibSQL/BTree.h>
#include <LibSQL/Database.h>
#include <LibSQL/Heap.h>
@ -217,6 +216,8 @@ ErrorOr<void> Database::remove(Row& row)
auto& table = row.table();
VERIFY(m_table_cache.get(table.key().hash()).has_value());
TRY(m_heap->free_storage(row.block_index()));
if (table.block_index() == row.block_index()) {
auto table_key = table.key();
table_key.set_block_index(row.next_block_index());