summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2019-11-14 16:51:36 +0100
committerLars Knoll <lars.knoll@qt.io>2020-07-02 11:29:11 +0200
commit6dd9c0720b3ae814aecf50453e91c3b450085471 (patch)
tree3c38cb3163af983759fac529e2d621a1f01cfae4
parent6a47b5850be2768742b1f83f637ffd8c348f836e (diff)
Small cleanup
Change-Id: Ic8ed50a05a9723ed252f0762d86e41fe719fc3ef Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/tools/qarraydata.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp
index b72ca20131..f22ff440bc 100644
--- a/src/corelib/tools/qarraydata.cpp
+++ b/src/corelib/tools/qarraydata.cpp
@@ -190,14 +190,6 @@ static QArrayData *allocateData(size_t allocSize, uint options)
return header;
}
-static QArrayData *reallocateData(QArrayData *header, size_t allocSize, uint options)
-{
- header = static_cast<QArrayData *>(::realloc(header, allocSize));
- if (header)
- header->flags = options;
- return header;
-}
-
void *QArrayData::allocate(QArrayData **dptr, size_t objectSize, size_t alignment,
size_t capacity, ArrayOptions options) noexcept
{
@@ -260,8 +252,9 @@ QArrayData::reallocateUnaligned(QArrayData *data, void *dataPointer,
size_t allocSize = calculateBlockSize(capacity, objectSize, headerSize, options);
qptrdiff offset = reinterpret_cast<char *>(dataPointer) - reinterpret_cast<char *>(data);
options |= AllocatedDataType | MutableData;
- QArrayData *header = reallocateData(data, allocSize, options);
+ QArrayData *header = static_cast<QArrayData *>(::realloc(data, size_t(allocSize)));
if (header) {
+ header->flags = options;
header->alloc = uint(capacity);
dataPointer = reinterpret_cast<char *>(header) + offset;
}