summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-10-05 18:44:31 +0200
committerAndreas Kling <kling@serenityos.org>2021-10-05 18:52:00 +0200
commit83bd6754776e8f3290c460feb28f261cffad6a9b (patch)
tree236fe3c0ee94d97c6c19cb1428c535edb3e5eb64 /Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h
parent19fc225b455957cf81d2038571a7f3713c01b555 (diff)
downloadserenity-83bd6754776e8f3290c460feb28f261cffad6a9b.zip
LibJS: Make WeakContainer pruning do less work
Instead of iterating *all* swept cells when pruning weak containers, only iterate the cells actually *in* the container. Also, instead of compiling a list of all swept cells, we can simply check the Cell::state() flag to know if something should be pruned.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h
index 681df05c3b..9fca911f34 100644
--- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h
+++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h
@@ -30,7 +30,7 @@ public:
bool remove_by_token(Object& unregister_token);
void cleanup(FunctionObject* callback = nullptr);
- virtual void remove_swept_cells(Badge<Heap>, Span<Cell*>) override;
+ virtual void remove_dead_cells(Badge<Heap>) override;
private:
virtual void visit_edges(Visitor& visitor) override;