diff options
author | Chris Adams <christopher.adams@nokia.com> | 2012-04-23 17:25:48 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-26 02:12:36 +0200 |
commit | 669ba098e44080991e0d17827622ecb8928650df (patch) | |
tree | b246b4a2181e66ccfd7057149a5e899753d25094 /src/qml/qml/qqmlboundsignal.cpp | |
parent | 8a69992c34bf456df54a5ba26955e782acd4531c (diff) |
Optimise memory usage of bound signals
We can save a few bytes per bound signal by using a flag pointer.
Change-Id: I96d23dc287722e549e21e4c5d978bed0ba2f4bed
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlboundsignal.cpp')
-rw-r--r-- | src/qml/qml/qqmlboundsignal.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp index db689b0fe2..c0475b1ed9 100644 --- a/src/qml/qml/qqmlboundsignal.cpp +++ b/src/qml/qml/qqmlboundsignal.cpp @@ -222,8 +222,10 @@ void QQmlAbstractBoundSignal::removeFromObject() QQmlBoundSignal::QQmlBoundSignal(QObject *scope, const QMetaMethod &signal, QObject *owner) -: m_expression(0), m_params(0), m_scope(scope), m_index(signal.methodIndex()), m_paramsValid(false), m_isEvaluating(false) +: m_expression(0), m_params(0), m_scope(scope), m_index(signal.methodIndex()) { + setParamsValid(false); + setIsEvaluating(false); addToObject(owner); callback = &subscriptionCallback; QQmlNotifierEndpoint::connect(scope, m_index); @@ -273,15 +275,15 @@ void QQmlBoundSignal::subscriptionCallback(QQmlNotifierEndpoint *e, void **a) if (QQmlDebugService::isDebuggingEnabled()) QV8DebugService::instance()->signalEmitted(QString::fromAscii(s->m_scope->metaObject()->method(s->m_index).methodSignature())); - QQmlHandlingSignalProfiler prof(s->m_scope, s->m_index, s->m_expression); + QQmlHandlingSignalProfiler prof(*(s->m_scope), s->m_index, s->m_expression); - s->m_isEvaluating = true; + s->setIsEvaluating(true); - if (!s->m_paramsValid) { + if (!s->paramsValid()) { QMetaMethod signal = s->m_scope->metaObject()->method(s->m_index); if (!signal.parameterTypes().isEmpty()) s->m_params = new QQmlBoundSignalParameters(signal, s); - s->m_paramsValid = true; + s->setParamsValid(true); } if (s->m_params) s->m_params->setValues(a); @@ -292,7 +294,7 @@ void QQmlBoundSignal::subscriptionCallback(QQmlNotifierEndpoint *e, void **a) } if (s->m_params) s->m_params->clearValues(); - s->m_isEvaluating = false; + s->setIsEvaluating(false); } QQmlBoundSignalParameters::QQmlBoundSignalParameters(const QMetaMethod &method, |