aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qqmlirbuilder_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-05-25 08:54:28 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-05-26 04:18:41 +0000
commita548679d0cd322ccfb45ac100d663c4a820f0554 (patch)
treec5fc5f775e43a159413ed8ea6b160e27aad3e0c1 /src/qml/compiler/qqmlirbuilder_p.h
parent573356464ba73afcbed173d939f9b54d8e201685 (diff)
Minor cleanup of pool array allocation
We store the CompiledData::Function indices for a give QML object in a fixed sized array in the memory pool in the IR. That array can be stored as pointer/len pair directly, there is no need for another pointer indirection. Change-Id: Iccad465ab873e0e7203dc563abb67cf6354a8bfd Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/qml/compiler/qqmlirbuilder_p.h')
-rw-r--r--src/qml/compiler/qqmlirbuilder_p.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/qml/compiler/qqmlirbuilder_p.h b/src/qml/compiler/qqmlirbuilder_p.h
index c53004a331..c46acc2481 100644
--- a/src/qml/compiler/qqmlirbuilder_p.h
+++ b/src/qml/compiler/qqmlirbuilder_p.h
@@ -170,7 +170,12 @@ class FixedPoolArray
public:
int count;
- void init(QQmlJS::MemoryPool *pool, const QVector<T> &vector)
+ FixedPoolArray()
+ : data(0)
+ , count(0)
+ {}
+
+ void allocate(QQmlJS::MemoryPool *pool, const QVector<T> &vector)
{
count = vector.count();
data = reinterpret_cast<T*>(pool->allocate(count * sizeof(T)));
@@ -312,7 +317,7 @@ public:
QString bindingAsString(Document *doc, int scriptIndex) const;
PoolList<CompiledFunctionOrExpression> *functionsAndExpressions;
- FixedPoolArray<int> *runtimeFunctionIndices;
+ FixedPoolArray<int> runtimeFunctionIndices;
private:
friend struct IRLoader;