diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2011-09-09 11:07:48 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-26 16:05:36 +0200 |
commit | 54255f7c5e7cecc58076c412183ce2d877a34c18 (patch) | |
tree | 29cddf2af89a144f794c86cb24cb1d5eb0db1de1 /src/corelib/tools/qvector.cpp | |
parent | 67fec4a5f5f164a24481921eab57955ce0d607f0 (diff) |
Make QVectorData::shared_null const
Similar to QByteArray and QString, keep the shared_null in shareable
memory and never modify it.
Since QRegion uses the internals of QVector, we need to make sure that
QRegion also never modifies the shared_null.
Change-Id: I809e5873fe414138f97d501e05458b73c04b18fb
Reviewed-on: http://codereview.qt-project.org/4529
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/tools/qvector.cpp')
-rw-r--r-- | src/corelib/tools/qvector.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp index 98a2412347..e1828c2b0f 100644 --- a/src/corelib/tools/qvector.cpp +++ b/src/corelib/tools/qvector.cpp @@ -52,7 +52,7 @@ static inline int alignmentThreshold() return 2 * sizeof(void*); } -QVectorData QVectorData::shared_null = { Q_BASIC_ATOMIC_INITIALIZER(1), 0, 0, true, false, 0 }; +const QVectorData QVectorData::shared_null = { Q_REFCOUNT_INITIALIZER(-1), 0, 0, true, false, 0 }; QVectorData *QVectorData::malloc(int sizeofTypedData, int size, int sizeofT, QVectorData *init) { |