Remove obsolete function
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>
This commit is contained in:
parent
66f192e294
commit
cc568ec342
@ -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));
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user