diff options
author | Liang Qi <liang.qi@qt.io> | 2018-02-27 08:43:10 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-02-27 08:43:10 +0100 |
commit | bb7a5d0cb6e62fa411e8b66759bf6b798c3f68d9 (patch) | |
tree | 06c325dc386afd26281ba0ebdbf4fd3f56f892b0 /src/qml/memory | |
parent | 41edb3bd9f373a865d5698ac8c18bf341071eae9 (diff) | |
parent | e41d067227eb6225b05df88ab724708588fa5304 (diff) |
Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4internalclass.cpp
src/qml/parser/qqmljslexer.cpp
src/qml/qml/v8/qv8engine.cpp
src/qml/util/qqmladaptormodel_p.h
src/quick/items/qquickanimatedsprite.cpp
tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp
Change-Id: I16702b7a0da29c2a332afee47728d6a6ebf4fb3f
Diffstat (limited to 'src/qml/memory')
-rw-r--r-- | src/qml/memory/qv4mm.cpp | 12 | ||||
-rw-r--r-- | src/qml/memory/qv4mm_p.h | 12 | ||||
-rw-r--r-- | src/qml/memory/qv4mmdefs_p.h | 6 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp index 9c51013317..cdda0bf7ef 100644 --- a/src/qml/memory/qv4mm.cpp +++ b/src/qml/memory/qv4mm.cpp @@ -186,7 +186,7 @@ struct MemorySegment { } PageReservation pageReservation; - Chunk *base = 0; + Chunk *base = nullptr; quint64 allocatedMap = 0; size_t availableBytes = 0; uint nChunks = 0; @@ -203,14 +203,14 @@ Chunk *MemorySegment::allocate(size_t size) } size_t requiredChunks = (size + sizeof(Chunk) - 1)/sizeof(Chunk); uint sequence = 0; - Chunk *candidate = 0; + Chunk *candidate = nullptr; for (uint i = 0; i < nChunks; ++i) { if (!testBit(i)) { if (!candidate) candidate = base + i; ++sequence; } else { - candidate = 0; + candidate = nullptr; sequence = 0; } if (sequence == requiredChunks) { @@ -221,7 +221,7 @@ Chunk *MemorySegment::allocate(size_t size) return candidate; } } - return 0; + return nullptr; } struct ChunkAllocator { @@ -594,7 +594,7 @@ HeapItem *BlockAllocator::allocate(size_t size, bool forceAllocation) { if (!m) { if (!forceAllocation) - return 0; + return nullptr; Chunk *newChunk = chunkAllocator->allocate(); Q_V4_PROFILE_ALLOC(engine, Chunk::DataSize, Profiling::HeapPage); chunks.push_back(newChunk); @@ -617,7 +617,7 @@ done: void BlockAllocator::sweep() { - nextFree = 0; + nextFree = nullptr; nFree = 0; memset(freeBins, 0, sizeof(freeBins)); diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h index 7dc73bdacc..1ef54ffcc6 100644 --- a/src/qml/memory/qv4mm_p.h +++ b/src/qml/memory/qv4mm_p.h @@ -105,7 +105,7 @@ struct BlockAllocator { void collectGrayItems(MarkStack *markStack); // bump allocations - HeapItem *nextFree = 0; + HeapItem *nextFree = nullptr; size_t nFree = 0; size_t usedSlotsAfterLastSweep = 0; HeapItem *freeBins[NumBins]; @@ -229,7 +229,7 @@ public: { Scope scope(engine); Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic)); - Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0)); + Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : nullptr)); Q_UNUSED(prototype); t->d_unchecked()->init(); return t->d(); @@ -240,7 +240,7 @@ public: { Scope scope(engine); Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic)); - Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0)); + Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : nullptr)); Q_UNUSED(prototype); t->d_unchecked()->init(arg1); return t->d(); @@ -251,7 +251,7 @@ public: { Scope scope(engine); Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic)); - Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0)); + Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : nullptr)); Q_UNUSED(prototype); t->d_unchecked()->init(arg1, arg2); return t->d(); @@ -262,7 +262,7 @@ public: { Scope scope(engine); Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic)); - Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0)); + Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : nullptr)); Q_UNUSED(prototype); t->d_unchecked()->init(arg1, arg2, arg3); return t->d(); @@ -273,7 +273,7 @@ public: { Scope scope(engine); Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic)); - Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : 0)); + Q_ASSERT(t->internalClass()->prototype == (prototype ? prototype->d() : nullptr)); Q_UNUSED(prototype); t->d_unchecked()->init(arg1, arg2, arg3, arg4); return t->d(); diff --git a/src/qml/memory/qv4mmdefs_p.h b/src/qml/memory/qv4mmdefs_p.h index 4e64ba8118..3e2bae46c2 100644 --- a/src/qml/memory/qv4mmdefs_p.h +++ b/src/qml/memory/qv4mmdefs_p.h @@ -272,9 +272,9 @@ Q_STATIC_ASSERT((1 << Chunk::BitShift) == Chunk::Bits); struct MarkStack { MarkStack(ExecutionEngine *engine); - Heap::Base **top = 0; - Heap::Base **base = 0; - Heap::Base **limit = 0; + Heap::Base **top = nullptr; + Heap::Base **base = nullptr; + Heap::Base **limit = nullptr; ExecutionEngine *engine; void push(Heap::Base *m) { *top = m; |