1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:57:44 +00:00

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
parent df176ca2d9
commit 04359995a7

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)