summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydata.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2019-12-02 16:06:48 +0100
committerLars Knoll <lars.knoll@qt.io>2020-07-06 21:30:19 +0200
commitf8a53388a78ba70ed609df8738db9bc75e99af86 (patch)
treedbab9ac59121cd18e246d751690b63805789a6db /src/corelib/tools/qarraydata.cpp
parenta8d5f3853741b6027658ad2c8a8d2b72a58de852 (diff)
Get rid of unused flags in QArrayData
Change-Id: I3ea754b44fb33e33baba0781d9ae15b7f3b3d8eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qarraydata.cpp')
-rw-r--r--src/corelib/tools/qarraydata.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp
index 9330a01a87..42599bbf2a 100644
--- a/src/corelib/tools/qarraydata.cpp
+++ b/src/corelib/tools/qarraydata.cpp
@@ -153,11 +153,11 @@ QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers")
const QArrayData QArrayData::shared_null[2] = {
- { Q_BASIC_ATOMIC_INITIALIZER(-1), QArrayData::StaticDataFlags, 0 }, // shared null
+ { Q_BASIC_ATOMIC_INITIALIZER(-1), 0, 0 }, // shared null
/* zero initialized terminator */};
static const QArrayData emptyNotNullShared[2] = {
- { Q_BASIC_ATOMIC_INITIALIZER(-1), QArrayData::StaticDataFlags, 0 }, // shared empty
+ { Q_BASIC_ATOMIC_INITIALIZER(-1), 0, 0 }, // shared empty
/* zero initialized terminator */};
QT_WARNING_POP
@@ -217,8 +217,6 @@ void *QArrayData::allocate(QArrayData **dptr, size_t objectSize, size_t alignmen
return nullptr;
size_t allocSize = calculateBlockSize(capacity, objectSize, headerSize, options);
- options |= AllocatedDataType | MutableData;
- options &= ~ImmutableHeader;
QArrayData *header = allocateData(allocSize, options);
quintptr data = 0;
if (header) {
@@ -241,7 +239,6 @@ QArrayData::reallocateUnaligned(QArrayData *data, void *dataPointer,
size_t headerSize = sizeof(QArrayData);
size_t allocSize = calculateBlockSize(capacity, objectSize, headerSize, options);
qptrdiff offset = dataPointer ? reinterpret_cast<char *>(dataPointer) - reinterpret_cast<char *>(data) : headerSize;
- options |= AllocatedDataType | MutableData;
QArrayData *header = static_cast<QArrayData *>(::realloc(data, size_t(allocSize)));
if (header) {
header->flags = options;
@@ -260,8 +257,6 @@ void QArrayData::deallocate(QArrayData *data, size_t objectSize,
Q_UNUSED(objectSize);
Q_UNUSED(alignment);
- Q_ASSERT_X(data == nullptr || !data->isStatic(), "QArrayData::deallocate",
- "Static data cannot be deleted");
::free(data);
}