diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-06-11 21:26:23 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-12-08 10:29:17 +0100 |
commit | 812a611dc05e5facd036856625ccb9274fdcb117 (patch) | |
tree | 06151f35165e3b2ae614d21be65e4555e19f45e7 /src/corelib/text/qstringliteral.h | |
parent | 62c673ccc6f81cee09a25f5acceec2768cea4672 (diff) |
Stop using the reference counter to store data state
Instead of using the reference count to store whether the data is
sharable and whether the header is immutable, move the settings to the
flags member. This allows us to save one comparison per deref() or
needsDetach(). It also allows for the possibility of mutable data
pointed to by a static header.
Change-Id: Ie678a2ff2bb9bce73497cb6138b431c465b0f3bb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/corelib/text/qstringliteral.h')
-rw-r--r-- | src/corelib/text/qstringliteral.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qstringliteral.h b/src/corelib/text/qstringliteral.h index 7b4d2d04f5..a0d4ddc30b 100644 --- a/src/corelib/text/qstringliteral.h +++ b/src/corelib/text/qstringliteral.h @@ -75,7 +75,7 @@ Q_STATIC_ASSERT_X(sizeof(qunicodechar) == 2, /**/ #define Q_STATIC_STRING_DATA_HEADER_INITIALIZER_WITH_OFFSET(size, offset) \ - { Q_REFCOUNT_INITIALIZE_STATIC, QArrayData::StaticDataFlags, size, 0, offset } \ + { Q_BASIC_ATOMIC_INITIALIZER(-1), QArrayData::StaticDataFlags, size, 0, offset } \ /**/ #define Q_STATIC_STRING_DATA_HEADER_INITIALIZER(size) \ |