Remove obsolete function
authorJoão Abecasis <joao.abecasis@nokia.com>
Thu, 10 Nov 2011 13:52:40 +0000 (14:52 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 19 Jan 2012 10:50:04 +0000 (11:50 +0100)
QVectorData::allocate is able to handle higher alignment that
QVectorData::malloc didn't.

This was kept for BC issues in the 4.x series, we can drop it now.

Change-Id: I7782bd2910de6b9c8dee3e63e621629dc3889d33
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
src/corelib/tools/qvector.cpp
src/corelib/tools/qvector.h

index 59ca111..a7a6add 100644 (file)
@@ -56,14 +56,6 @@ static inline int alignmentThreshold()
 
 const QVectorData QVectorData::shared_null = { Q_REFCOUNT_INITIALIZE_STATIC, 0, 0, false, 0 };
 
-QVectorData *QVectorData::malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init)
-{
-    QVectorData* p = (QVectorData *)::malloc(sizeofTypedData + (size - 1) * sizeofT);
-    Q_CHECK_PTR(p);
-    ::memcpy(p, init, sizeofTypedData + (qMin(size, init->alloc) - 1) * sizeofT);
-    return p;
-}
-
 QVectorData *QVectorData::allocate(int size, int alignment)
 {
     return static_cast<QVectorData *>(alignment > alignmentThreshold() ? qMallocAligned(size, alignment) : ::malloc(size));
index 51364df..0116d1d 100644 (file)
@@ -78,10 +78,6 @@ struct Q_CORE_EXPORT QVectorData
 #endif
 
     static const QVectorData shared_null;
-    // ### Qt 5: rename to 'allocate()'. The current name causes problems for
-    // some debugges when the QVector is member of a class within an unnamed namespace.
-    // ### Qt 5: can be removed completely. (Ralf)
-    static QVectorData *malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init);
     static QVectorData *allocate(int size, int alignment);
     static QVectorData *reallocate(QVectorData *old, int newsize, int oldsize, int alignment);
     static void free(QVectorData *data, int alignment);