diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-01 05:29:26 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-04-01 05:29:26 (GMT) |
commit | 8e87197c2afa19df1fb15cb9b6b3cc17c3d4c0d6 (patch) | |
tree | 691fe48f981f40f2d50790ceeb7d3719799d9b82 /src/corelib | |
parent | b1748ec7a9fdcd74fcf05af3903623c7165420ad (diff) | |
download | Qt-8e87197c2afa19df1fb15cb9b6b3cc17c3d4c0d6.zip Qt-8e87197c2afa19df1fb15cb9b6b3cc17c3d4c0d6.tar.gz Qt-8e87197c2afa19df1fb15cb9b6b3cc17c3d4c0d6.tar.bz2 |
Optimization: Improve allocation strategy for QDeclarativeDeclarativeData
This improves the declarative/creation/itemtree_qml benchmark by 6%
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 8 | ||||
-rw-r--r-- | src/corelib/kernel/qobject_p.h | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index dbc6be2..dfd6a08 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -125,8 +125,10 @@ extern "C" Q_CORE_EXPORT void qt_removeObject(QObject *) } } +void (*QDeclarativeData::destroyed)(QDeclarativeData *, QObject *) = 0; +void (*QDeclarativeData::parentChanged)(QDeclarativeData *, QObject *, QObject *) = 0; + QObjectData::~QObjectData() {} -QDeclarativeData::~QDeclarativeData() {} QObjectPrivate::QObjectPrivate(int version) : threadData(0), connectionLists(0), senders(0), currentSender(0), currentChildBeingDeleted(0) @@ -876,7 +878,7 @@ QObject::~QObject() } if (d->declarativeData) - d->declarativeData->destroyed(this); + QDeclarativeData::destroyed(d->declarativeData, this); { QMutex *signalSlotMutex = 0; @@ -2025,7 +2027,7 @@ void QObjectPrivate::setParent_helper(QObject *o) } } if (!wasDeleted && declarativeData) - declarativeData->parentChanged(q, o); + QDeclarativeData::parentChanged(declarativeData, q, o); } /*! diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h index 3b59abb..e5d904c 100644 --- a/src/corelib/kernel/qobject_p.h +++ b/src/corelib/kernel/qobject_p.h @@ -87,9 +87,8 @@ enum { QObjectPrivateVersion = QT_VERSION }; class Q_CORE_EXPORT QDeclarativeData { public: - virtual ~QDeclarativeData(); - virtual void destroyed(QObject *) = 0; - virtual void parentChanged(QObject *, QObject *) = 0; + static void (*destroyed)(QDeclarativeData *, QObject *); + static void (*parentChanged)(QDeclarativeData *, QObject *, QObject *); }; class Q_CORE_EXPORT QObjectPrivate : public QObjectData |