aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlabstractbinding_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-04-23 21:57:06 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-10 11:41:00 +0000
commit5d5343a6bc02c0df3723cb9650067e972aebe8ff (patch)
tree624aca781e8bd3a095bbaeef972c9b994727116c /src/qml/qml/qqmlabstractbinding_p.h
parent9de77e056583b0bcfd7e17d855ac8956847c58eb (diff)
Save one more pointer on each binding
Fold the isAddedToObject flag into the nextBinding pointer. Reorder the members to avoid holes in the data. Change-Id: I0a216940f52020a5d48a6ed05cc236c248161b08 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/qqmlabstractbinding_p.h')
-rw-r--r--src/qml/qml/qqmlabstractbinding_p.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/qml/qml/qqmlabstractbinding_p.h b/src/qml/qml/qqmlabstractbinding_p.h
index 79107bb04c..dd14301aa9 100644
--- a/src/qml/qml/qqmlabstractbinding_p.h
+++ b/src/qml/qml/qqmlabstractbinding_p.h
@@ -96,35 +96,30 @@ public:
};
RefCount ref;
-private:
+protected:
friend class QQmlData;
friend class QQmlValueTypeProxyBinding;
friend class QQmlObjectCreator;
- typedef QSharedPointer<QQmlAbstractBinding> SharedPointer;
-
inline void setAddedToObject(bool v);
inline bool isAddedToObject() const;
inline void setNextBinding(QQmlAbstractBinding *);
- // Pointer to the next binding in the linked list of bindings.
- Ptr m_nextBinding;
-
-protected:
- QFlagPointer<QObject> m_target;
int m_targetIndex;
- bool m_isAddedToObject;
+ QFlagPointer<QObject> m_target;
+ // Pointer to the next binding in the linked list of bindings.
+ QFlagPointer<QQmlAbstractBinding> m_nextBinding;
};
void QQmlAbstractBinding::setAddedToObject(bool v)
{
- m_isAddedToObject = v;
+ m_nextBinding.setFlagValue(v);
}
bool QQmlAbstractBinding::isAddedToObject() const
{
- return m_isAddedToObject;
+ return m_nextBinding.flag();
}
QQmlAbstractBinding *QQmlAbstractBinding::nextBinding() const
@@ -134,6 +129,10 @@ QQmlAbstractBinding *QQmlAbstractBinding::nextBinding() const
void QQmlAbstractBinding::setNextBinding(QQmlAbstractBinding *b)
{
+ if (b)
+ b->ref.ref();
+ if (m_nextBinding.data() && !m_nextBinding->ref.deref())
+ delete m_nextBinding.data();
m_nextBinding = b;
}