summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qvarlengtharray.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-02-20 10:07:29 +0100
committerMarc Mutz <marc.mutz@kdab.com>2017-02-22 08:04:12 +0000
commit19085350fb3b9de89a4c3e5a6c1c7bbb2a43c324 (patch)
tree6a23805fed9ead17b7a12b07794834edcfe90cdb /src/corelib/tools/qvarlengtharray.h
parent4df229ce50d72e814c34b73c14a30c4d3d4724b1 (diff)
Do not use QTypeInfo::isStatic anymore
... except in QList. When dafa3618 introduced isRelocatable and QTypeInfoQuery, the intention was to decouple the memory layout of QList from the reallocation optimizations in QVector. This never happened, as QVector (and QVarLengthArray) continue to use isStatic to this day. Fix by porting both QVector and QVLA to QTypeInfoQuery and isRelocatable. Change-Id: I6951f2cf21f0cbb24e2dbd38f80f1bd82007d394 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qvarlengtharray.h')
-rw-r--r--src/corelib/tools/qvarlengtharray.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index bb5ae78d2b..25f5176c22 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -352,7 +352,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
a = Prealloc;
}
s = 0;
- if (QTypeInfo<T>::isStatic) {
+ if (!QTypeInfoQuery<T>::isRelocatable) {
QT_TRY {
// copy all the old elements
while (s < copySize) {
@@ -445,7 +445,7 @@ Q_OUTOFLINE_TEMPLATE typename QVarLengthArray<T, Prealloc>::iterator QVarLengthA
if (n != 0) {
resize(s + n);
const T copy(t);
- if (QTypeInfo<T>::isStatic) {
+ if (!QTypeInfoQuery<T>::isRelocatable) {
T *b = ptr + offset;
T *j = ptr + s;
T *i = j - n;