Remove some scopes in the memory manager

These allocation functions only perform a single
allocation. Since all live objects have to be reachable
by the GC before calling into it, these scopes are not
required.

Change-Id: Ia7e89791d6ff2bfe87b7c5462191d28e04688df1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
Lars Knoll 2018-01-22 14:16:33 +01:00
parent ce2f9621e0
commit 28bb56634b
1 changed files with 6 additions and 8 deletions

View File

@ -224,19 +224,17 @@ public:
template <typename ObjectType, typename... Args>
typename ObjectType::Data *allocObject(Heap::InternalClass *ic, Args... args)
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
t->d_unchecked()->init(args...);
return t->d();
typename ObjectType::Data *d = allocateObject<ObjectType>(ic);
d->init(args...);
return d;
}
template <typename ObjectType, typename... Args>
typename ObjectType::Data *allocObject(InternalClass *ic, Args... args)
{
Scope scope(engine);
Scoped<ObjectType> t(scope, allocateObject<ObjectType>(ic));
t->d_unchecked()->init(args...);
return t->d();
typename ObjectType::Data *d = allocateObject<ObjectType>(ic);
d->init(args...);
return d;
}
template <typename ObjectType, typename... Args>