summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qvarlengtharray.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2012-04-17 12:58:41 +0200
committerLars Knoll <lars.knoll@nokia.com>2012-04-17 12:58:52 +0200
commit64255ef6502b1144f7b0aa4b2bf62803e0d4788b (patch)
tree29bf116bfda2ccf61057115690d14f85cc9b085b /src/corelib/tools/qvarlengtharray.h
parent4a9fb41a7947d0bb7a47a9625603a436df288b24 (diff)
parent7e0beba891cb963a1d535bd45b0be78b43b8d07f (diff)
Merge remote-tracking branch 'origin/api_changes'
Diffstat (limited to 'src/corelib/tools/qvarlengtharray.h')
-rw-r--r--src/corelib/tools/qvarlengtharray.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index 4e042f765e..639d2463fd 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -48,6 +48,7 @@
#include <new>
#include <string.h>
+#include <stdlib.h>
QT_BEGIN_HEADER
@@ -77,7 +78,7 @@ public:
i->~T();
}
if (ptr != reinterpret_cast<T *>(array))
- qFree(ptr);
+ free(ptr);
}
inline QVarLengthArray<T, Prealloc> &operator=(const QVarLengthArray<T, Prealloc> &other)
{
@@ -190,7 +191,7 @@ template <class T, int Prealloc>
Q_INLINE_TEMPLATE QVarLengthArray<T, Prealloc>::QVarLengthArray(int asize)
: s(asize) {
if (s > Prealloc) {
- ptr = reinterpret_cast<T *>(qMalloc(s * sizeof(T)));
+ ptr = reinterpret_cast<T *>(malloc(s * sizeof(T)));
Q_CHECK_PTR(ptr);
a = s;
} else {
@@ -229,7 +230,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::append(const T *abuf, in
while (s < asize)
new (ptr+(s++)) T(*abuf++);
} else {
- qMemCopy(&ptr[s], abuf, increment * sizeof(T));
+ memcpy(&ptr[s], abuf, increment * sizeof(T));
s = asize;
}
}
@@ -243,7 +244,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
const int copySize = qMin(asize, osize);
if (aalloc != a) {
- ptr = reinterpret_cast<T *>(qMalloc(aalloc * sizeof(T)));
+ ptr = reinterpret_cast<T *>(malloc(aalloc * sizeof(T)));
Q_CHECK_PTR(ptr);
if (ptr) {
s = 0;
@@ -263,11 +264,11 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
while (sClean < osize)
(oldPtr+(sClean++))->~T();
if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr)
- qFree(oldPtr);
+ free(oldPtr);
QT_RETHROW;
}
} else {
- qMemCopy(ptr, oldPtr, copySize * sizeof(T));
+ memcpy(ptr, oldPtr, copySize * sizeof(T));
}
} else {
ptr = oldPtr;
@@ -283,7 +284,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
}
if (oldPtr != reinterpret_cast<T *>(array) && oldPtr != ptr)
- qFree(oldPtr);
+ free(oldPtr);
if (QTypeInfo<T>::isComplex) {
// call default constructor for new objects (which can throw)