diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Heap/Heap.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Heap/Heap.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Heap/Heap.cpp b/Userland/Libraries/LibJS/Heap/Heap.cpp index 3329489e0e..d0bc3ba289 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.cpp +++ b/Userland/Libraries/LibJS/Heap/Heap.cpp @@ -191,9 +191,15 @@ public: void Heap::mark_live_cells(const HashTable<Cell*>& roots) { dbgln_if(HEAP_DEBUG, "mark_live_cells:"); + MarkingVisitor visitor; for (auto* root : roots) visitor.visit(root); + + for (auto& inverse_root : m_uprooted_cells) + inverse_root->set_marked(false); + + m_uprooted_cells.clear(); } void Heap::sweep_dead_cells(bool print_report, const Core::ElapsedTimer& measurement_timer) @@ -327,4 +333,9 @@ void Heap::undefer_gc(Badge<DeferGC>) } } +void Heap::uproot_cell(Cell* cell) +{ + m_uprooted_cells.append(cell); +} + } |