diff options
| author | Ulf Hermann <[email protected]> | 2023-07-06 14:43:39 +0200 |
|---|---|---|
| committer | Ulf Hermann <[email protected]> | 2023-07-11 14:11:46 +0200 |
| commit | 4e69f2468ad599b7175f60e08341d37689512c9c (patch) | |
| tree | 0687df61f190c636fddd2c1ba892d85aa3f1abaa /src/qml/qmltc | |
| parent | 48034fddb083b0f05b7d9cb950d9a6f78f8e8858 (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.cpp | 1 |
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()); |
