aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/util
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-06-13 14:30:03 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2014-07-22 13:49:19 +0200
commitb393c405b7568e80628bc99501a9c53bbd0e678d (patch)
tree51280658b1ec97947a66c6afc503b23ae48f0d8d /src/qml/util
parent00a46fa07bf87c6ffa0d60b4a98b51685fdc1ef5 (diff)
Change the object allocation scheme
Instead of allocating the data directly, centralize the object and its ::Data allocation in one place in the memory manager. This is in preparation for additional pointer indirection later. Change-Id: I7880e1e7354b3258b6a8965be378cd09c9467d25 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/util')
-rw-r--r--src/qml/util/qqmladaptormodel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp
index d33000559b..6349c6fa31 100644
--- a/src/qml/util/qqmladaptormodel.cpp
+++ b/src/qml/util/qqmladaptormodel.cpp
@@ -227,8 +227,8 @@ public:
const QByteArray &propertyName = it.key();
QV4::ScopedString name(scope, v4->newString(QString::fromUtf8(propertyName)));
- QV4::ScopedFunctionObject g(scope, new (v4) QV4::IndexedBuiltinFunction::Data(v4->rootContext, propertyId, QQmlDMCachedModelData::get_property));
- QV4::ScopedFunctionObject s(scope, new (v4) QV4::IndexedBuiltinFunction::Data(v4->rootContext, propertyId, QQmlDMCachedModelData::set_property));
+ QV4::ScopedFunctionObject g(scope, v4->memoryManager->alloc<QV4::IndexedBuiltinFunction>(v4->rootContext, propertyId, QQmlDMCachedModelData::get_property));
+ QV4::ScopedFunctionObject s(scope, v4->memoryManager->alloc<QV4::IndexedBuiltinFunction>(v4->rootContext, propertyId, QQmlDMCachedModelData::set_property));
p->setGetter(g);
p->setSetter(s);
proto->insertMember(name.getPointer(), p, QV4::Attr_Accessor|QV4::Attr_NotEnumerable|QV4::Attr_NotConfigurable);
@@ -433,7 +433,7 @@ public:
}
QV4::Scope scope(v4);
QV4::ScopedObject proto(scope, type->prototype.value());
- QV4::ScopedObject o(scope, new (proto->engine()) QQmlDelegateModelItemObject::Data(proto->engine(), this));
+ QV4::ScopedObject o(scope, proto->engine()->memoryManager->alloc<QQmlDelegateModelItemObject>(proto->engine(), this));
o->setPrototype(proto.getPointer());
++scriptRef;
return o.asReturnedValue();
@@ -611,7 +611,7 @@ public:
{
QQmlAdaptorModelEngineData *data = engineData(v4->v8Engine);
QV4::Scope scope(v4);
- QV4::ScopedObject o(scope, new (v4) QQmlDelegateModelItemObject::Data(v4, this));
+ QV4::ScopedObject o(scope, v4->memoryManager->alloc<QQmlDelegateModelItemObject>(v4, this));
QV4::ScopedObject p(scope, data->listItemProto.value());
o->setPrototype(p.getPointer());
++scriptRef;