summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Heap/Heap.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-21 19:51:19 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-21 19:51:19 +0200
commit3fe1be20b7ec04542947159f996b62c620dd5171 (patch)
tree3849e910b3eae73222f92a20c487da08ef8d40d5 /Userland/Libraries/LibJS/Heap/Heap.cpp
parent746b310061e8ba90aa0de40070c38fc97adde4cd (diff)
downloadserenity-3fe1be20b7ec04542947159f996b62c620dd5171.zip
LibJS: Use IntrusiveList for keeping track of MarkedValueLists
Diffstat (limited to 'Userland/Libraries/LibJS/Heap/Heap.cpp')
-rw-r--r--Userland/Libraries/LibJS/Heap/Heap.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Heap/Heap.cpp b/Userland/Libraries/LibJS/Heap/Heap.cpp
index 16555b0a2d..0c46359a2d 100644
--- a/Userland/Libraries/LibJS/Heap/Heap.cpp
+++ b/Userland/Libraries/LibJS/Heap/Heap.cpp
@@ -94,8 +94,8 @@ void Heap::gather_roots(HashTable<Cell*>& roots)
for (auto& handle : m_handles)
roots.set(handle.cell());
- for (auto* list : m_marked_value_lists) {
- for (auto& value : list->values()) {
+ for (auto& list : m_marked_value_lists) {
+ for (auto& value : list.values()) {
if (value.is_cell())
roots.set(&value.as_cell());
}
@@ -270,14 +270,14 @@ void Heap::did_destroy_handle(Badge<HandleImpl>, HandleImpl& impl)
void Heap::did_create_marked_value_list(Badge<MarkedValueList>, MarkedValueList& list)
{
- VERIFY(!m_marked_value_lists.contains(&list));
- m_marked_value_lists.set(&list);
+ VERIFY(!m_marked_value_lists.contains(list));
+ m_marked_value_lists.append(list);
}
void Heap::did_destroy_marked_value_list(Badge<MarkedValueList>, MarkedValueList& list)
{
- VERIFY(m_marked_value_lists.contains(&list));
- m_marked_value_lists.remove(&list);
+ VERIFY(m_marked_value_lists.contains(list));
+ m_marked_value_lists.remove(list);
}
void Heap::did_create_weak_container(Badge<WeakContainer>, WeakContainer& set)