aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-03-05 13:48:13 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2021-03-05 15:54:59 +0100
commite58746dc1f848662250cdd4c986b53d017f7a653 (patch)
tree3158071c87daaacde0799bb75f8c407334caea9d
parenta4ba25117962fab13fa9d71edc252d2d1b59715c (diff)
QQmlPropertyCache: Optimize layout to avoid padding
Change-Id: I4022cf5acf63e2e2e9257acd1dd4439b85645faf Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp6
-rw-r--r--src/qml/qml/qqmlpropertycache_p.h12
2 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp
index f2f6b975eb..8ffdc42d82 100644
--- a/src/qml/qml/qqmlpropertycache.cpp
+++ b/src/qml/qml/qqmlpropertycache.cpp
@@ -151,9 +151,9 @@ void QQmlPropertyData::load(const QMetaMethod &m)
Creates a new empty QQmlPropertyCache.
*/
QQmlPropertyCache::QQmlPropertyCache()
- : _parent(nullptr), propertyIndexCacheStart(0), methodIndexCacheStart(0),
- signalHandlerIndexCacheStart(0), _hasPropertyOverrides(false),
- argumentsCache(nullptr), _jsFactoryMethodIndex(-1)
+ : propertyIndexCacheStart(0), _parent(nullptr),
+ argumentsCache(nullptr), methodIndexCacheStart(0), signalHandlerIndexCacheStart(0),
+ _jsFactoryMethodIndex(-1), _hasPropertyOverrides(false)
{
}
diff --git a/src/qml/qml/qqmlpropertycache_p.h b/src/qml/qml/qqmlpropertycache_p.h
index 4c9395601c..93661caf91 100644
--- a/src/qml/qml/qqmlpropertycache_p.h
+++ b/src/qml/qml/qqmlpropertycache_p.h
@@ -268,10 +268,8 @@ private:
}
private:
+ int propertyIndexCacheStart; // placed here to avoid gap between QQmlRefCount and _parent
QQmlPropertyCache *_parent;
- int propertyIndexCacheStart;
- int methodIndexCacheStart;
- int signalHandlerIndexCacheStart;
IndexCache propertyIndexCache;
IndexCache methodIndexCache;
@@ -280,15 +278,17 @@ private:
AllowedRevisionCache allowedRevisionCache;
QVector<QQmlEnumData> enumCache;
- bool _hasPropertyOverrides : 1;
- bool _ownMetaObject : 1;
RefCountedMetaObject _metaObject;
QByteArray _dynamicClassName;
QByteArray _dynamicStringData;
QString _defaultPropertyName;
QQmlPropertyCacheMethodArguments *argumentsCache;
- int _jsFactoryMethodIndex;
QByteArray _checksum;
+ int methodIndexCacheStart;
+ int signalHandlerIndexCacheStart;
+ int _jsFactoryMethodIndex;
+ bool _hasPropertyOverrides;
+ bool _ownMetaObject;
};
// Returns this property cache's metaObject. May be null if it hasn't been created yet.