diff options
| author | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-11-21 19:36:26 +0100 |
|---|---|---|
| committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2023-12-20 08:38:26 +0100 |
| commit | b9d37a328ba09bcb2a7a95b5778cb8c63d0ace26 (patch) | |
| tree | 340739253c3e15f0b6c051434d94061e8e3385c6 /src/quicktestutils/qml/qmlutils.cpp | |
| parent | d08ede57dd530a67c3420b3858fe39bf1e5eb598 (diff) | |
Long live incremental garbage collection in QML!
The design of the garbage collector is described in
src/qml/memory/design.md.
The gc and gcdone test helpers are adjusted to drive the gc to
completion, even when in incremental mode.
Parts of tst_qv4mm and tst_qqmlqt need to run with the incremental gc
disabled, as they call gc inside QML and assumes that the GC finishes
before returning.
Initial-patch-by: Rafal Chomentowski <rafal.chomentowski@ge.com>
Task-number: QTBUG-119274
Change-Id: I1d94f41bc7a434fad67de0fd46454b6db285f2eb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/quicktestutils/qml/qmlutils.cpp')
| -rw-r--r-- | src/quicktestutils/qml/qmlutils.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quicktestutils/qml/qmlutils.cpp b/src/quicktestutils/qml/qmlutils.cpp index 6cc54af356..64edc91a1c 100644 --- a/src/quicktestutils/qml/qmlutils.cpp +++ b/src/quicktestutils/qml/qmlutils.cpp @@ -112,14 +112,14 @@ QQmlTestMessageHandler::~QQmlTestMessageHandler() bool gcDone(const QV4::ExecutionEngine *engine) { - // always true as long as the gc is non-incremental - Q_UNUSED(engine); - return true; + return !engine->memoryManager->gcStateMachine->inProgress(); } void gc(QV4::ExecutionEngine &engine, GCFlags flags) { engine.memoryManager->runGC(); + while (!gcDone(&engine)) + engine.memoryManager->gcStateMachine->step(); if (int(GCFlags::DontSendPostedEvents) & int(flags)) return; QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); |
