aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4arraydata.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@digia.com>2016-09-08 11:07:26 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2016-09-30 14:14:31 +0000
commitb80fa8e7d59c2824de067ab4d488d865a6e69d94 (patch)
treedfbab030756f9c5a0f76aba8a558f429311724a2 /src/qml/jsruntime/qv4arraydata.cpp
parentc2e28350a6ea866b9e68059f232aaeccd47f743b (diff)
QML: Make all context objects trivial
This change also adds a check to the d() calls for Managed, verifies that the object has been initialized. This is only done for debug builds. To prevent other code from tripping the check, a number of other classes are either marked as trivial, or do initialization in the constructors. Because of template function changes in them memory manager (those now call init() instead of in-place new), String has an extra parameter to force it to temporarily use an old/unmodified template function. Change-Id: I8c35161ce7680835d830638b6d21498c5129b02b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4arraydata.cpp')
-rw-r--r--src/qml/jsruntime/qv4arraydata.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp
index f4afe46fcb..74c83b1940 100644
--- a/src/qml/jsruntime/qv4arraydata.cpp
+++ b/src/qml/jsruntime/qv4arraydata.cpp
@@ -143,13 +143,13 @@ void ArrayData::realloc(Object *o, Type newType, uint requested, bool enforceAtt
Scoped<ArrayData> newData(scope);
if (newType < Heap::ArrayData::Sparse) {
Heap::SimpleArrayData *n = scope.engine->memoryManager->allocManaged<SimpleArrayData>(size);
- new (n) Heap::SimpleArrayData;
+ n->init();
n->offset = 0;
n->len = d ? d->d()->len : 0;
newData = n;
} else {
Heap::SparseArrayData *n = scope.engine->memoryManager->allocManaged<SparseArrayData>(size);
- new (n) Heap::SparseArrayData;
+ n->init();
newData = n;
}
newData->setAlloc(alloc);