From b393c405b7568e80628bc99501a9c53bbd0e678d Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 13 Jun 2014 14:30:03 +0200 Subject: 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 --- src/qml/jsruntime/qv4functionobject.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/qml/jsruntime/qv4functionobject.cpp') diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index efc2b172ef..10974780f3 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -173,14 +173,14 @@ void FunctionObject::markObjects(Managed *that, ExecutionEngine *e) Object::markObjects(that, e); } -FunctionObject::Data *FunctionObject::createScriptFunction(ExecutionContext *scope, Function *function, bool createProto) +FunctionObject *FunctionObject::createScriptFunction(ExecutionContext *scope, Function *function, bool createProto) { if (function->needsActivation() || function->compiledFunction->flags & CompiledData::Function::HasCatchOrWith || function->compiledFunction->nFormals > QV4::Global::ReservedArgumentCount || function->isNamedExpression()) - return new (scope->d()->engine) ScriptFunction::Data(scope, function); - return new (scope->d()->engine) SimpleScriptFunction::Data(scope, function, createProto); + return scope->d()->engine->memoryManager->alloc(scope, function); + return scope->d()->engine->memoryManager->alloc(scope, function, createProto); } DEFINE_OBJECT_VTABLE(FunctionCtor); -- cgit v1.2.3