summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Heap/HeapBlock.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-25 18:35:27 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-25 18:37:37 +0200
commit789d20ebb7b0c7089c49ca1df549bba4aac78996 (patch)
tree2b4d8b6f977488ca5a576978a319ef69a4eece86 /Userland/Libraries/LibJS/Heap/HeapBlock.cpp
parent91656d63c7fd5b75dc4edef26591b8a97ce02b8b (diff)
downloadserenity-789d20ebb7b0c7089c49ca1df549bba4aac78996.zip
LibJS: Replace Cell live bit with a cell state
So far we only have two states: Live and Dead. In the future, we can add additional states to support incremental sweeping and/or multi- stage cell destruction.
Diffstat (limited to 'Userland/Libraries/LibJS/Heap/HeapBlock.cpp')
-rw-r--r--Userland/Libraries/LibJS/Heap/HeapBlock.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Heap/HeapBlock.cpp b/Userland/Libraries/LibJS/Heap/HeapBlock.cpp
index 97bd82dc58..70ec9ce885 100644
--- a/Userland/Libraries/LibJS/Heap/HeapBlock.cpp
+++ b/Userland/Libraries/LibJS/Heap/HeapBlock.cpp
@@ -47,11 +47,11 @@ void HeapBlock::deallocate(Cell* cell)
{
VERIFY(is_valid_cell_pointer(cell));
VERIFY(!m_freelist || is_valid_cell_pointer(m_freelist));
- VERIFY(cell->is_live());
+ VERIFY(cell->state() == Cell::State::Live);
VERIFY(!cell->is_marked());
cell->~Cell();
auto* freelist_entry = new (cell) FreelistEntry();
- freelist_entry->set_live(false);
+ freelist_entry->set_state(Cell::State::Dead);
freelist_entry->next = m_freelist;
m_freelist = freelist_entry;
}