diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2012-05-14 15:51:28 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-18 02:24:35 +0200 |
commit | 2d2580838d580edbac22a2cf906a4d6da2d670ef (patch) | |
tree | 33dedd58a0e06b5e93386c867667a67b82672169 /src/qml/qml/qqmlboundsignal_p.h | |
parent | 4c9b4c951934a3ba277dcbf565215305a27d2e06 (diff) |
Improve memory usage of Connections and signal handlers.
Following the pattern of 330152354aed8496ac78d145e14b25ee2d7bf8fb, store
the source as Utf8. Keep one less copy of the source when possible.
Change-Id: Ifa5f5fdc9ea3d48e904489dc262145eff36e710c
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlboundsignal_p.h')
-rw-r--r-- | src/qml/qml/qqmlboundsignal_p.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlboundsignal_p.h b/src/qml/qml/qqmlboundsignal_p.h index a81060021c..f9159ee70f 100644 --- a/src/qml/qml/qqmlboundsignal_p.h +++ b/src/qml/qml/qqmlboundsignal_p.h @@ -83,7 +83,7 @@ public: QString sourceFile() const { return m_fileName; } int lineNumber() const { return m_line; } int columnNumber() const { return m_column; } - QString expression() const { return m_expression; } + QString expression() const; QQmlEngine *engine() const { return context() ? context()->engine : 0; } @@ -93,8 +93,12 @@ private: v8::Persistent<v8::Object> m_v8qmlscope; v8::Persistent<v8::Function> m_v8function; - QString m_expression; - QString m_functionName; // hint for debugger + //either expressionUtf8 or expression will be used (but not both). + //once m_v8function is valid, we clear both expressions, and + //extract it from m_v8function if needed. + QByteArray m_expressionUtf8; + QString m_expression; //only used when expression needs to be rewritten + QString m_fileName; int m_line; int m_column; |