mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibWeb: Intentionally leak the main thread JS VM
This way we avoid doing an expensive full GC on exit.
This commit is contained in:
parent
a3b2b20782
commit
d32f7112dc
Notes:
sideshowbarker
2024-07-17 07:44:13 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d32f7112dc
1 changed files with 5 additions and 0 deletions
|
@ -51,6 +51,11 @@ JS::VM& main_thread_vm()
|
|||
static RefPtr<JS::VM> vm;
|
||||
if (!vm) {
|
||||
vm = JS::VM::create(make<WebEngineCustomData>());
|
||||
|
||||
// NOTE: We intentionally leak the main thread JavaScript VM.
|
||||
// This avoids doing an exhaustive garbage collection on process exit.
|
||||
vm->ref();
|
||||
|
||||
static_cast<WebEngineCustomData*>(vm->custom_data())->event_loop.set_vm(*vm);
|
||||
|
||||
// FIXME: Implement 8.1.5.1 HostEnsureCanCompileStrings(callerRealm, calleeRealm), https://html.spec.whatwg.org/multipage/webappapis.html#hostensurecancompilestrings(callerrealm,-calleerealm)
|
||||
|
|
Loading…
Reference in a new issue