From bb3999a22d3282911005865135c9d6d49ae65728 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Fri, 9 Feb 2024 21:44:02 +0100 Subject: QV4 garbage collection: Allocate white during gc run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we properly employ the WriteBarrier, we no longer need to use black allocations. This reduces the amount of floating garbage, and avoids potential bugs with heap classes like QV4::MemberData where we rely on it being marked so that its constituents don't have to be protected during initialization – which would fail when we it is already black, as it wouldn't be pushed on the MarkStack afterwards. Fixes: QTBUG-121910 Change-Id: Ie5e0f9461fa5c0e4a293da3d3c978da73743e417 Reviewed-by: Ulf Hermann --- src/qml/memory/qv4mm_p.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/qml/memory/qv4mm_p.h') diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h index 74aa0b639f..a16ea580b1 100644 --- a/src/qml/memory/qv4mm_p.h +++ b/src/qml/memory/qv4mm_p.h @@ -320,12 +320,6 @@ public: typename ManagedType::Data *allocIC() { Heap::Base *b = *allocate(&icAllocator, align(sizeof(typename ManagedType::Data))); - if (m_markStack) { - // If the gc is running right now, it will not have a chance to mark the newly created item - // and may therefore sweep it right away. - // Protect the new object from the current GC run to avoid this. - b->setMarkBit(); - } return static_cast(b); } -- cgit v1.2.3