LibJS: Exclude FinalizationRegistries with queued cleanup jobs from GC

This is done by just adding them to the list of GC roots, which
prevents the VM from trying to run cleanup job of garbage collected
registries.
This commit is contained in:
Idan Horowitz 2021-08-15 00:04:00 +03:00 committed by Linus Groh
commit 04359995a7
Notes: sideshowbarker 2024-07-18 05:42:57 +09:00

View file

@ -120,6 +120,9 @@ void VM::gather_roots(HashTable<Cell*>& roots)
for (auto* job : m_promise_jobs)
roots.set(job);
for (auto* finalization_registry : m_finalization_registry_cleanup_jobs)
roots.set(finalization_registry);
}
Symbol* VM::get_global_symbol(const String& description)