mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +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:
parent
df176ca2d9
commit
04359995a7
Notes:
sideshowbarker
2024-07-18 05:42:57 +09:00
Author: https://github.com/IdanHo
Commit: 04359995a7
Pull-request: https://github.com/SerenityOS/serenity/pull/9423
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/linusg ✅
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue