diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-01-22 14:16:33 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-12 13:59:27 +0000 |
commit | 28bb56634b786564ec4623b7f143255f5b87686f (patch) | |
tree | 7addc396c2bac4c6fb5c4f3daf6cb7ea050412cf /src | |
parent | ce2f9621e01c8f0afbbdcda7ae226c8bc276d024 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/memory/qv4mm_p.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h index bc9b7130c7..d61655c38a 100644 --- a/src/qml/memory/qv4mm_p.h +++ b/src/qml/memory/qv4mm_p.h @@ -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> |