aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2024-02-09 21:44:02 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2024-03-05 14:06:29 +0100
commitbb3999a22d3282911005865135c9d6d49ae65728 (patch)
tree62c9ecc64940b380c2ddd84b02a4a5475281b1d6 /tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
parentd6d224892e6672dc3ed8f027b54277fe8a7971f9 (diff)
QV4 garbage collection: Allocate white during gc run
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 <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index c1e6c4c96f..bd60093a7b 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -8122,12 +8122,9 @@ void tst_qqmlecmascript::onDestructionViaGC()
v4->memoryManager->allocate<QV4::WeakReferenceSentinel>(weakRef.data(), &sentinelResult);
}
gc(engine);
-
+ QVERIFY2(weakRef->isNullOrUndefined(), "The weak value was not cleared");
QVERIFY2(mutatorResult, "We failed to re-assign the weak reference a new value during GC");
- QVERIFY2(!sentinelResult, "The weak value was cleared on first GC run");
- QVERIFY2(!weakRef->isNullOrUndefined(), "The weak value was cleared on first GC run");
- gc(engine);
- QVERIFY2(weakRef->isNullOrUndefined(), "The weak value was not cleared on second gc run");
+ QVERIFY2(sentinelResult, "The weak reference was not cleared properly");
}
struct EventProcessor : public QObject