diff options
author | Fredrik Orderud <forderud@gmail.com> | 2016-05-13 16:35:09 +0200 |
---|---|---|
committer | Fredrik Orderud <forderud@gmail.com> | 2016-05-17 19:24:53 +0000 |
commit | 880f491c26b0a4253f8af34e9e6811fea85306d6 (patch) | |
tree | f23b393a293650f0173fdb050c2b6c63e33def6d | |
parent | 38baf18df4c572ef36dc203ea9172f3e7b44e06d (diff) |
Temporarily remove use of a custom allocator for QNodePropertyChanges.
Backport of 9927e58063c7bfcb7fedf4f0e01a672dd6ff6b24 from 5.7 branch.
Might be related to QTBUG-50704. The custom operators also need
improving so that we can use QSharedPointer::create() with them. Once
the change refactorings are complete we can look at re-adding the use
of the allocator to all change types not just QNodePropertyChange.
Task-number: QTBUG-50704
Task-number: QTBUG-51494
Change-Id: Ifd357fecf0e5f58b7198ff526a9dcf9f43e20fa5
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | src/core/qscenepropertychange.cpp | 28 | ||||
-rw-r--r-- | src/core/qscenepropertychange.h | 3 | ||||
-rw-r--r-- | src/core/qscenepropertychange_p.h | 8 |
3 files changed, 0 insertions, 39 deletions
diff --git a/src/core/qscenepropertychange.cpp b/src/core/qscenepropertychange.cpp index 18045db86..683e3c49d 100644 --- a/src/core/qscenepropertychange.cpp +++ b/src/core/qscenepropertychange.cpp @@ -36,7 +36,6 @@ #include "qscenepropertychange.h" #include "qscenepropertychange_p.h" -#include <Qt3DCore/private/qframeallocator_p.h> QT_BEGIN_NAMESPACE @@ -47,9 +46,6 @@ namespace Qt3DCore { \inmodule Qt3DCore */ -QFrameAllocator *QScenePropertyChangePrivate::m_allocator = new QFrameAllocator(128, sizeof(QScenePropertyChange), sizeof(QScenePropertyChangePrivate) * 2); -QMutex QScenePropertyChangePrivate::m_mutex; - QScenePropertyChangePrivate::QScenePropertyChangePrivate() : QSceneChangePrivate() { @@ -60,18 +56,6 @@ QScenePropertyChangePrivate::~QScenePropertyChangePrivate() } -void *QScenePropertyChangePrivate::operator new(size_t size) -{ - QMutexLocker locker(&QScenePropertyChangePrivate::m_mutex); - return QScenePropertyChangePrivate::m_allocator->allocateRawMemory(size); -} - -void QScenePropertyChangePrivate::operator delete(void *ptr, size_t size) -{ - QMutexLocker locker(&QScenePropertyChangePrivate::m_mutex); - QScenePropertyChangePrivate::m_allocator->deallocateRawMemory(ptr, size); -} - QScenePropertyChange::QScenePropertyChange(ChangeFlag type, ObservableType observableType, const QNodeId &subjectId, QSceneChange::Priority priority) : QSceneChange(*new QScenePropertyChangePrivate, type, observableType, subjectId, priority) { @@ -117,18 +101,6 @@ void QScenePropertyChange::setValue(const QVariant &value) d->m_value = value; } -void *QScenePropertyChange::operator new(size_t n) -{ - QMutexLocker locker(&QScenePropertyChangePrivate::m_mutex); - return QScenePropertyChangePrivate::m_allocator->allocateRawMemory(n); -} - -void QScenePropertyChange::operator delete(void *ptr, size_t size) -{ - QMutexLocker locker(&QScenePropertyChangePrivate::m_mutex); - QScenePropertyChangePrivate::m_allocator->deallocateRawMemory(ptr, size); -} - } // Qt3D QT_END_NAMESPACE diff --git a/src/core/qscenepropertychange.h b/src/core/qscenepropertychange.h index 992e1e6ae..23552ad34 100644 --- a/src/core/qscenepropertychange.h +++ b/src/core/qscenepropertychange.h @@ -57,9 +57,6 @@ public: void setPropertyName(const char *name); void setValue(const QVariant &value); - static void *operator new(size_t size); - static void operator delete(void *ptr, size_t size); - protected: Q_DECLARE_PRIVATE(QScenePropertyChange) QScenePropertyChange(QScenePropertyChangePrivate &dd); diff --git a/src/core/qscenepropertychange_p.h b/src/core/qscenepropertychange_p.h index 3c2150952..55c934810 100644 --- a/src/core/qscenepropertychange_p.h +++ b/src/core/qscenepropertychange_p.h @@ -50,14 +50,12 @@ #include <private/qscenechange_p.h> #include <QVariant> -#include <QMutex> QT_BEGIN_NAMESPACE namespace Qt3DCore { class QScenePropertyChange; -class QFrameAllocator; class QScenePropertyChangePrivate : public QSceneChangePrivate { @@ -65,18 +63,12 @@ public: QScenePropertyChangePrivate(); virtual ~QScenePropertyChangePrivate(); - static void *operator new(size_t size); - static void operator delete(void *ptr, size_t size); - Q_DECLARE_PUBLIC(QScenePropertyChange) /// FIXME: use QMetaProperty here once the NodeAboutToBeDeleted etc. change events /// get refactored to their own QSceneChange subclass const char *m_propertyName; QVariant m_value; - - static QFrameAllocator *m_allocator; - static QMutex m_mutex; }; } // Qt3D |