diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2024-01-15 16:36:50 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2024-03-05 14:06:29 +0100 |
commit | 2b7e1b11a105af928a8d2999e60bb1110af3edae (patch) | |
tree | 0275a71322153039fb5c4f666144033722668041 /src/qml/memory/qv4mm_p.h | |
parent | e44cd366eefbec33cc0387344a84f594636ec84b (diff) |
qv4mm: Rework interaction between allocation and incremental gc
We simplify the runGC logic as follows:
- runGC is now only used to start the gc cycle.
- MemoryMananger::onEventLoop now directly calls GCStateMachine::step
instead of fiddling with gcBlocked and calling.
- allocate calls runGC (as before) if no gc is ongoing; but due to the
changes above it doesn't have to modify gcBlocked.
Change-Id: If858b68416b1bca07a6193c66adaf150ff149720
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/memory/qv4mm_p.h')
-rw-r--r-- | src/qml/memory/qv4mm_p.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h index 4f7df449c5..ff74c4067c 100644 --- a/src/qml/memory/qv4mm_p.h +++ b/src/qml/memory/qv4mm_p.h @@ -369,9 +369,7 @@ private: HeapItem *allocate(BlockAllocator *allocator, std::size_t size) { - // We must not call runGC if incremental gc is running - // so temporarily set gcBlocked in that case, too - QBoolBlocker block(gcBlocked, m_markStack != nullptr || gcBlocked); + const bool incrementalGCIsAlreadyRunning = m_markStack != nullptr; bool didGCRun = false; if (aggressiveGC) { |