summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydata.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-06-04 21:36:46 +0200
committerLars Knoll <lars.knoll@qt.io>2019-12-07 14:18:04 +0100
commit64db4861bfcacc8849e8452b73d5c940d97aefd0 (patch)
treec39991072737ea1253adf5affb321ca7f4923f79 /src/corelib/tools/qarraydata.cpp
parentbf0b4f332a2f1ec9860c610d98cd27e483869bec (diff)
Replace QArrayData::capacityReserved with a full flags field
Instead of stealing one bit from the alloc field, let's use a full 32-bit for the flags. The first flag to be in the field is the CapacityReserved (even though the allocate() function will store some others there, not relevant for now). This is done in preparation for the need for more flags necessary anyway. Change-Id: I4c997d14743495e0d4558a6fb0a6042eb3d4975d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/corelib/tools/qarraydata.cpp')
-rw-r--r--src/corelib/tools/qarraydata.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp
index 592faf39c3..ce6f138497 100644
--- a/src/corelib/tools/qarraydata.cpp
+++ b/src/corelib/tools/qarraydata.cpp
@@ -183,7 +183,7 @@ static QArrayData *reallocateData(QArrayData *header, size_t allocSize, uint opt
{
header = static_cast<QArrayData *>(::realloc(header, allocSize));
if (header)
- header->capacityReserved = bool(options & QArrayData::CapacityReserved);
+ header->flags = options;
return header;
}
@@ -219,7 +219,7 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
header->ref.atomic.storeRelaxed(1);
header->size = 0;
header->alloc = capacity;
- header->capacityReserved = bool(options & CapacityReserved);
+ header->flags = options;
header->offset = data - quintptr(header);
}