diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-07-06 14:43:39 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-07-11 14:11:46 +0200 |
commit | 4e69f2468ad599b7175f60e08341d37689512c9c (patch) | |
tree | 0687df61f190c636fddd2c1ba892d85aa3f1abaa /src/qml/qml/qqmlmetatype.cpp | |
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 <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml/qml/qqmlmetatype.cpp')
-rw-r--r-- | src/qml/qml/qqmlmetatype.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 462027682e..9d217147e4 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -64,7 +64,6 @@ static QQmlTypePrivate *createQQmlType(QQmlMetaTypeData *data, d->extraData.interfaceTypeData = type.iid; d->typeId = type.typeId; d->listId = type.listId; - d->isSetup.storeRelease(true); d->module = QString::fromUtf8(type.uri); d->version = type.version; data->registerType(d); @@ -1031,11 +1030,6 @@ QQmlType QQmlMetaType::typeForUrl(const QString &urlString, return type; } -QRecursiveMutex *QQmlMetaType::typeRegistrationLock() -{ - return metaTypeDataLock(); -} - /* Returns the latest version of \a uri installed, or an in valid QTypeRevision(). */ |