summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydata.h
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.h
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.h')
-rw-r--r--src/corelib/tools/qarraydata.h23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h
index c921e4eaa5..7624f7ad20 100644
--- a/src/corelib/tools/qarraydata.h
+++ b/src/corelib/tools/qarraydata.h
@@ -52,22 +52,11 @@ template <class T> struct QTypedArrayData;
struct Q_CORE_EXPORT QArrayData
{
enum ArrayOption {
- RawDataType = 0x0001, //!< this class is really a QArrayData
- AllocatedDataType = 0x0002, //!< this class is really a QArrayAllocatedData
- DataTypeBits = 0x000f,
-
- CapacityReserved = 0x0010, //!< the capacity was reserved by the user, try to keep it
- GrowsForward = 0x0020, //!< allocate with eyes towards growing through append()
- GrowsBackwards = 0x0040, //!< allocate with eyes towards growing through prepend()
- MutableData = 0x0080, //!< the data can be changed; doesn't say anything about the header
- ImmutableHeader = 0x0100, //!< the header is static, it can't be changed
-
- /// this option is used by the Q_ARRAY_LITERAL and similar macros
- StaticDataFlags = RawDataType | ImmutableHeader,
/// this option is used by the allocate() function
- DefaultAllocationFlags = MutableData,
- /// this option is used by the prepareRawData() function
- DefaultRawFlags = 0
+ DefaultAllocationFlags = 0,
+ CapacityReserved = 0x1, //!< the capacity was reserved by the user, try to keep it
+ GrowsForward = 0x2, //!< allocate with eyes towards growing through append()
+ GrowsBackwards = 0x4 //!< allocate with eyes towards growing through prepend()
};
Q_DECLARE_FLAGS(ArrayOptions, ArrayOption)
@@ -106,12 +95,12 @@ struct Q_CORE_EXPORT QArrayData
// follow COW principles.
bool isMutable() const
{
- return flags & MutableData;
+ return ref_.loadRelaxed() != -1;
}
bool isStatic() const
{
- return flags & ImmutableHeader;
+ return !isMutable();
}
bool isShared() const