aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsapi/qjsvalue.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2015-01-14 16:22:33 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2015-01-21 18:22:52 +0100
commit8209f35b7961b7ea6867d7ebfb5288dcf40ecd71 (patch)
treef9e8b5083788574b75d7dba7f4ca1c60eded86fe /src/qml/jsapi/qjsvalue.h
parentd8131513b07d3f0a6d749c9961b294fc955fed6d (diff)
Rework QJSValue internals
Use a flagged pointer to either store a pointer to a QV4::Value (from the persistent storage) or a pointer to a QVariant in QJSValue::d. Like this we don't need to malloc to create a QJSValue for most use cases. Significantly reduces the memory consumption of QJSValue and speeds it up a lot. Change-Id: I10902cc4b6cc3f43d3f816875dc6c4bbb6b4490f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsapi/qjsvalue.h')
-rw-r--r--src/qml/jsapi/qjsvalue.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/qml/jsapi/qjsvalue.h b/src/qml/jsapi/qjsvalue.h
index 4ff86b1edc..19736803c1 100644
--- a/src/qml/jsapi/qjsvalue.h
+++ b/src/qml/jsapi/qjsvalue.h
@@ -49,7 +49,6 @@ struct QMetaObject;
class QDateTime;
typedef QList<QJSValue> QJSValueList;
-class QJSValuePrivate;
namespace QV4 {
struct ExecutionEngine;
struct Value;
@@ -140,7 +139,7 @@ private:
// force compile error, prevent QJSValue(bool) to be called
QJSValue(void *) Q_DECL_EQ_DELETE;
- QJSValuePrivate *d;
+ mutable quintptr d;
};
QT_END_NAMESPACE