aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
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/qml/v8/qqmlbuiltinfunctions.cpp
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/qml/v8/qqmlbuiltinfunctions.cpp')
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index 0d4ffaf9f8..e07d97e67c 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -1256,7 +1256,7 @@ ReturnedValue QtObject::method_binding(CallContext *ctx)
if (!f)
V4THROW_TYPE("binding(): argument (binding expression) must be a function");
- return (new (ctx->d()->engine) QQmlBindingFunction::Data(f))->asReturnedValue();
+ return (ctx->d()->engine->memoryManager->alloc<QQmlBindingFunction>(f))->asReturnedValue();
}
@@ -1587,10 +1587,10 @@ void QV4::GlobalExtensions::init(QQmlEngine *qmlEngine, Object *globalObject)
globalObject->defineDefaultProperty(QStringLiteral("print"), ConsoleObject::method_log);
globalObject->defineDefaultProperty(QStringLiteral("gc"), method_gc);
- ScopedObject console(scope, new (v4) QV4::ConsoleObject::Data(v4));
+ ScopedObject console(scope, v4->memoryManager->alloc<QV4::ConsoleObject>(v4));
globalObject->defineDefaultProperty(QStringLiteral("console"), console);
- ScopedObject qt(scope, new (v4) QV4::QtObject::Data(v4, qmlEngine));
+ ScopedObject qt(scope, v4->memoryManager->alloc<QV4::QtObject>(v4, qmlEngine));
globalObject->defineDefaultProperty(QStringLiteral("Qt"), qt);
// string prototype extension