From 8c809fa5ee52903921191db91dce432b8a62dd01 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 10 Nov 2024 15:11:19 +0100 Subject: [PATCH] LibCore: Don't reserve 2 KiB of stack memory when processing event queue The inline capacity on ThreadEventQueue::Private::queued_events caused us to reserve (and importantly, not initialize!) 2 KiB of stack memory when entering ThreadEventQueue::process(). This was causing any leftover pointers to GC-allocated objects within that memory range to keep those objects alive, even when all other references were gone. --- Libraries/LibCore/ThreadEventQueue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibCore/ThreadEventQueue.cpp b/Libraries/LibCore/ThreadEventQueue.cpp index 5b1845f462a..a3676cd5573 100644 --- a/Libraries/LibCore/ThreadEventQueue.cpp +++ b/Libraries/LibCore/ThreadEventQueue.cpp @@ -35,7 +35,7 @@ struct ThreadEventQueue::Private { }; Threading::Mutex mutex; - Vector queued_events; + Vector queued_events; Vector>>, 16> pending_promises; bool warned_promise_count { false }; };