aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qmltc
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2023-07-06 14:43:39 +0200
committerUlf Hermann <[email protected]>2023-07-11 14:11:46 +0200
commit4e69f2468ad599b7175f60e08341d37689512c9c (patch)
tree0687df61f190c636fddd2c1ba892d85aa3f1abaa /src/qml/qmltc
parent48034fddb083b0f05b7d9cb950d9a6f78f8e8858 (diff)
QtQml: Clean up lazy-loading of parts of QQmlTypePrivate
The meta objects and the enums are lazily loaded semi-independently from each other. Their data structures take up a lot of space. We only want to incur that cost if they are actually needed. Furthermore, the lazy-loading needs to be thread-safe. The easiest way to make a thread safe lazy loading structure is via a mutable atomic pointer to an immutable object. Refactor QQmlTypePrivate to do just that. This reduces the memory usage of the base structure by about 50%, cuts down on the locking required to set up the extra aspects, and generally makes the code more readable. Change-Id: I815338d3e4de02b2f535ab2fee748bba47719efc Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
Diffstat (limited to 'src/qml/qmltc')
-rw-r--r--src/qml/qmltc/qqmltcobjectcreationhelper.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/qml/qmltc/qqmltcobjectcreationhelper.cpp b/src/qml/qmltc/qqmltcobjectcreationhelper.cpp
index 693277f0f1..e5b2be9ad5 100644
--- a/src/qml/qmltc/qqmltcobjectcreationhelper.cpp
+++ b/src/qml/qmltc/qqmltcobjectcreationhelper.cpp
@@ -45,7 +45,6 @@ void qmltcCreateDynamicMetaObject(QObject *object, const QmltcTypeData &data)
qmlTypePrivate->extraData.cppTypeData->registerEnumsFromRelatedTypes = false;
qmlTypePrivate->baseMetaObject = data.metaObject;
- qmlTypePrivate->init();
QQmlType qmlType(qmlTypePrivate);
Q_ASSERT(qmlType.isValid());