aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/memory/qv4mm_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-03-07 08:48:57 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2018-03-08 09:02:02 +0000
commitc99abf1851bbbfcec11eb77173df620746940ab0 (patch)
treea8f4b9c1ebe9cb78d7ac585aa8b299a2a820fdca /src/qml/memory/qv4mm_p.h
parent73e8321255d9f0e70529a58c10dbaf4790a9a659 (diff)
Fix issue with allocating huge objects in the memory manager
We shouldn't allocate objects that are larger than the size of a standard memory segment through the chunk allocator, as this can lead to problems when freeing the segment and then re-using it again. Instead allocate a private MemorySegment for these objects, and free it when the object gets garbage collected. Task-number: QTBUG-66732 Change-Id: Ic24ff65d204977f313ab0adaf7a8132883e525f0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/memory/qv4mm_p.h')
-rw-r--r--src/qml/memory/qv4mm_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h
index 1ef54ffcc6..40670bcdc7 100644
--- a/src/qml/memory/qv4mm_p.h
+++ b/src/qml/memory/qv4mm_p.h
@@ -69,6 +69,7 @@ QT_BEGIN_NAMESPACE
namespace QV4 {
struct ChunkAllocator;
+struct MemorySegment;
struct BlockAllocator {
BlockAllocator(ChunkAllocator *chunkAllocator, ExecutionEngine *engine)
@@ -136,6 +137,7 @@ struct HugeItemAllocator {
ChunkAllocator *chunkAllocator;
ExecutionEngine *engine;
struct HugeChunk {
+ MemorySegment *segment;
Chunk *chunk;
size_t size;
};