summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-05-01 13:05:51 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-05-01 13:08:42 +0200
commitccc6efb6e91756451ffd50d51f7f3ae05bc6df0b (patch)
treea65fb418e4e0ce27e6cd73f65500e7cc00bbf106 /src/corelib
parentd52b00e1d3cc60c81b54a89d6da488dc4bbce384 (diff)
parent079f2bf5d8a4221b821ec8062affe2efaa9668a0 (diff)
Merge remote-tracking branch 'origin/release' into stable
This merge adds the opengl rename. Change-Id: I84ea0b6abee9780ebb2cf3f64ab9e3fdf2acab3e
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/codecs/qutfcodec.cpp44
-rw-r--r--src/corelib/doc/snippets/code/doc_src_plugins-howto.pro4
-rw-r--r--src/corelib/doc/src/plugins-howto.qdoc50
-rw-r--r--src/corelib/global/qglobal.h3
-rw-r--r--src/corelib/kernel/qobject.h2
-rw-r--r--src/corelib/tools/qarraydata.cpp13
-rw-r--r--src/corelib/tools/qarraydata.h4
-rw-r--r--src/corelib/tools/qarraydatapointer.h4
-rw-r--r--src/corelib/tools/qcontiguouscache.h2
-rw-r--r--src/corelib/tools/qhash.h2
-rw-r--r--src/corelib/tools/qlinkedlist.h2
-rw-r--r--src/corelib/tools/qlist.h2
-rw-r--r--src/corelib/tools/qmap.h2
-rw-r--r--src/corelib/tools/qrefcount.h18
-rw-r--r--src/corelib/tools/qset.h2
-rw-r--r--src/corelib/tools/qstring.cpp24
-rw-r--r--src/corelib/tools/qvector.h14
17 files changed, 124 insertions, 68 deletions
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index 54312601e4..072cda63aa 100644
--- a/src/corelib/codecs/qutfcodec.cpp
+++ b/src/corelib/codecs/qutfcodec.cpp
@@ -52,6 +52,8 @@ QT_BEGIN_NAMESPACE
enum { Endian = 0, Data = 1 };
+static const uchar utf8bom[] = { 0xef, 0xbb, 0xbf };
+
#if defined(__SSE2__) && defined(QT_COMPILER_SUPPORTS_SSE2)
static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const ushort *&src, const ushort *end)
{
@@ -187,9 +189,9 @@ QByteArray QUtf8::convertFromUnicode(const QChar *uc, int len, QTextCodec::Conve
int invalid = 0;
if (state && !(state->flags & QTextCodec::IgnoreHeader)) {
// append UTF-8 BOM
- *cursor++ = 0xef;
- *cursor++ = 0xbb;
- *cursor++ = 0xbf;
+ *cursor++ = utf8bom[0];
+ *cursor++ = utf8bom[1];
+ *cursor++ = utf8bom[2];
}
const ushort *nextAscii = src;
@@ -240,19 +242,31 @@ QString QUtf8::convertToUnicode(const char *chars, int len)
const uchar *src = reinterpret_cast<const uchar *>(chars);
const uchar *end = src + len;
- while (src < end) {
- const uchar *nextAscii = end;
- if (simdDecodeAscii(dst, nextAscii, src, end))
- break;
+ // attempt to do a full decoding in SIMD
+ const uchar *nextAscii = end;
+ if (!simdDecodeAscii(dst, nextAscii, src, end)) {
+ // at least one non-ASCII entry
+ // check if we failed to decode the UTF-8 BOM; if so, skip it
+ if (Q_UNLIKELY(src == reinterpret_cast<const uchar *>(chars))
+ && end - src >= 3
+ && Q_UNLIKELY(src[0] == utf8bom[0] && src[1] == utf8bom[1] && src[2] == utf8bom[2])) {
+ src += 3;
+ }
- do {
- uchar b = *src++;
- int res = QUtf8Functions::fromUtf8<QUtf8BaseTraits>(b, dst, src, end);
- if (res < 0) {
- // decoding error
- *dst++ = QChar::ReplacementCharacter;
- }
- } while (src < nextAscii);
+ while (src < end) {
+ nextAscii = end;
+ if (simdDecodeAscii(dst, nextAscii, src, end))
+ break;
+
+ do {
+ uchar b = *src++;
+ int res = QUtf8Functions::fromUtf8<QUtf8BaseTraits>(b, dst, src, end);
+ if (res < 0) {
+ // decoding error
+ *dst++ = QChar::ReplacementCharacter;
+ }
+ } while (src < nextAscii);
+ }
}
result.truncate(dst - reinterpret_cast<const ushort *>(result.constData()));
diff --git a/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro b/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro
index 5eb9604ed7..dc75c1d9d7 100644
--- a/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro
+++ b/src/corelib/doc/snippets/code/doc_src_plugins-howto.pro
@@ -43,7 +43,7 @@ CONFIG += release
#! [3]
#! [4]
-CONFIG += qpa_minimal_plugin
+QTPLUGIN.platforms = qminimal
#! [4]
#! [5]
@@ -53,7 +53,7 @@ QTPLUGIN += qjpeg \
#! [5]
#! [6]
-CONFIG -= import_qpa_plugin
+QTPLUGIN.platforms = -
#! [6]
#! [7]
diff --git a/src/corelib/doc/src/plugins-howto.qdoc b/src/corelib/doc/src/plugins-howto.qdoc
index 7565d610cc..7dc0d01cce 100644
--- a/src/corelib/doc/src/plugins-howto.qdoc
+++ b/src/corelib/doc/src/plugins-howto.qdoc
@@ -234,7 +234,7 @@
application is to compile it into a dynamic library that is shipped
separately, and detected and loaded at runtime.
- Plugins can be linked statically against your application. If you
+ Plugins can be linked statically into your application. If you
build the static version of Qt, this is the only option for
including Qt's predefined plugins. Using static plugins makes the
deployment less error-prone, but has the disadvantage that no
@@ -253,7 +253,8 @@
\row \li \c qico \li Image formats \li ICO
\row \li \c qsvg \li Image formats \li SVG
\row \li \c qtiff \li Image formats \li TIFF
- \row \li \c qsqldb2 \li SQL driver \li IBM DB2 \row \li \c qsqlibase \li SQL driver \li Borland InterBase
+ \row \li \c qsqldb2 \li SQL driver \li IBM DB2
+ \row \li \c qsqlibase \li SQL driver \li Borland InterBase
\row \li \c qsqlite \li SQL driver \li SQLite version 3
\row \li \c qsqlite2 \li SQL driver \li SQLite version 2
\row \li \c qsqlmysql \li SQL driver \li MySQL
@@ -263,22 +264,48 @@
\row \li \c qsqltds \li SQL driver \li Sybase Adaptive Server (TDS)
\endtable
- To link statically against those plugins, you need to add
+ To link those plugins statically, you need to add
the required plugins to your build using \c QTPLUGIN.
- Q_IMPORT_PLUGIN() macros are also needed in application code,
- but those are automatically generated by qmake and added to
- your application project.
In the \c .pro file for your application, you need the following
entry:
\snippet code/doc_src_plugins-howto.pro 5
+ qmake automatically adds the plugins to QTPLUGIN that are typically
+ needed by the used Qt modules (see \c QT), while more specialized
+ plugins need to be added manually.
+ The default list of automatically added plugins can be overridden
+ per type.
+ For example, to link the minimal plugin instead of the default Qt
+ platform adaptation plugin, use:
+
+ \snippet code/doc_src_plugins-howto.pro 4
+
+ If you want neither the default nor the minimal QPA plugin to be
+ linked automatically, use:
+
+ \snippet code/doc_src_plugins-howto.pro 6
+
+ The defaults are tuned towards an optimal out-of-the-box experience,
+ but may unnecessarily bloat the application.
+ It is recommended to inspect the linker command line built by qmake
+ and eliminate unnecessary plugins.
+
+ \section2 Details of Linking Static Plugins
+
+ To cause static plugins actually being linked and instantiated,
+ Q_IMPORT_PLUGIN() macros are also needed in application code,
+ but those are automatically generated by qmake and added to
+ your application project.
+
If you do not want all plugins added to QTPLUGIN to be automatically
linked, remove \c import_plugins from the \c CONFIG variable:
\snippet code/doc_src_plugins-howto.pro 7
+ \section2 Creating Static Plugins
+
It is also possible to create your own static plugins, by
following these steps:
@@ -297,17 +324,6 @@
to make sure that the \c{QT_STATICPLUGIN} preprocessor macro is
defined.
- The default Qt platform adaptation plugin is automatically added to QTPLUGIN
- in static builds. If you want to add the minimal plugin instead, add \c qpa_minimal_plugin
- to \c CONFIG:
-
- \snippet code/doc_src_plugins-howto.pro 4
-
- If you want neither the default nor the minimal QPA plugin to be linked automatically,
- remove \c import_qpa_plugin from \c CONFIG:
-
- \snippet code/doc_src_plugins-howto.pro 6
-
\section1 Deploying and Debugging Plugins
The \l{Deploying Plugins} document covers the process of deploying
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 09f2d73db4..707e46dd40 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -58,7 +58,10 @@
#if !defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_CONFIGURE)
#include <QtCore/qconfig.h>
#include <QtCore/qfeatures.h>
+#endif
#define QT_SUPPORTS(FEATURE) (!defined(QT_NO_##FEATURE))
+#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
+# define QT_NO_UNSHARABLE_CONTAINERS
#endif
/* These two macros makes it possible to turn the builtin line expander into a
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index ee6ef23139..a54690606a 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -549,7 +549,7 @@ template <class T> inline const char * qobject_interface_iid()
Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *);
#endif
-class Q_CORE_EXPORT QSignalBlocker
+class QSignalBlocker
{
public:
inline explicit QSignalBlocker(QObject *o);
diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp
index 825b3289c7..12736d5c2e 100644
--- a/src/corelib/tools/qarraydata.cpp
+++ b/src/corelib/tools/qarraydata.cpp
@@ -75,10 +75,13 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
&& !(alignment & (alignment - 1)));
// Don't allocate empty headers
- if (!(options & RawData) && !capacity)
- return !(options & Unsharable)
- ? const_cast<QArrayData *>(&qt_array_empty)
- : const_cast<QArrayData *>(&qt_array_unsharable_empty);
+ if (!(options & RawData) && !capacity) {
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+ if (options & Unsharable)
+ return const_cast<QArrayData *>(&qt_array_unsharable_empty);
+#endif
+ return const_cast<QArrayData *>(&qt_array_empty);
+ }
size_t headerSize = sizeof(QArrayData);
@@ -118,8 +121,10 @@ void QArrayData::deallocate(QArrayData *data, size_t objectSize,
&& !(alignment & (alignment - 1)));
Q_UNUSED(objectSize) Q_UNUSED(alignment)
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
if (data == &qt_array_unsharable_empty)
return;
+#endif
Q_ASSERT_X(!data->ref.isStatic(), "QArrayData::deallocate", "Static data can not be deleted");
::free(data);
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h
index ffb2b8765e..10a9e35542 100644
--- a/src/corelib/tools/qarraydata.h
+++ b/src/corelib/tools/qarraydata.h
@@ -80,7 +80,9 @@ struct Q_CORE_EXPORT QArrayData
enum AllocationOption {
CapacityReserved = 0x1,
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
Unsharable = 0x2,
+#endif
RawData = 0x4,
Grow = 0x8,
@@ -99,8 +101,10 @@ struct Q_CORE_EXPORT QArrayData
AllocationOptions detachFlags() const
{
AllocationOptions result;
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
if (!ref.isSharable())
result |= Unsharable;
+#endif
if (capacityReserved)
result |= CapacityReserved;
return result;
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index 533f7a306f..2245106ec0 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -134,6 +134,7 @@ public:
return (!d->isMutable() || d->ref.isShared());
}
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
void setSharable(bool sharable)
{
if (needsDetach()) {
@@ -147,6 +148,9 @@ public:
}
}
+ bool isSharable() const { return d->isSharable(); }
+#endif
+
void swap(QArrayDataPointer &other)
{
qSwap(d, other.d);
diff --git a/src/corelib/tools/qcontiguouscache.h b/src/corelib/tools/qcontiguouscache.h
index d601ddb819..e05ef33aa2 100644
--- a/src/corelib/tools/qcontiguouscache.h
+++ b/src/corelib/tools/qcontiguouscache.h
@@ -104,7 +104,9 @@ public:
inline void detach() { if (d->ref.load() != 1) detach_helper(); }
inline bool isDetached() const { return d->ref.load() == 1; }
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); d->sharable = sharable; }
+#endif
QContiguousCache<T> &operator=(const QContiguousCache<T> &other);
#ifdef Q_COMPILER_RVALUE_REFS
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 40e501355c..f68b02be2c 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -330,7 +330,9 @@ public:
inline void detach() { if (d->ref.isShared()) detach_helper(); }
inline bool isDetached() const { return !d->ref.isShared(); }
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); if (d != &QHashData::shared_null) d->sharable = sharable; }
+#endif
inline bool isSharedWith(const QHash<Key, T> &other) const { return d == other.d; }
void clear();
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index bdacdbcd26..3377d1bbc3 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -106,7 +106,9 @@ public:
inline void detach()
{ if (d->ref.isShared()) detach_helper2(this->e); }
inline bool isDetached() const { return !d->ref.isShared(); }
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { if (!sharable) detach(); if (d != &QLinkedListData::shared_null) d->sharable = sharable; }
+#endif
inline bool isSharedWith(const QLinkedList<T> &other) const { return d == other.d; }
inline bool isEmpty() const { return d->size == 0; }
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 3a0d01aa8d..9e4ba70908 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -146,6 +146,7 @@ public:
}
inline bool isDetached() const { return !d->ref.isShared(); }
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())
@@ -155,6 +156,7 @@ public:
if (d != &QListData::shared_null)
d->ref.setSharable(sharable);
}
+#endif
inline bool isSharedWith(const QList<T> &other) const { return d == other.d; }
inline bool isEmpty() const { return p.isEmpty(); }
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 487039ccfb..76f8bd6f17 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -377,6 +377,7 @@ public:
inline void detach() { if (d->ref.isShared()) detach_helper(); }
inline bool isDetached() const { return !d->ref.isShared(); }
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())
@@ -386,6 +387,7 @@ public:
// Don't call on shared_null
d->ref.setSharable(sharable);
}
+#endif
inline bool isSharedWith(const QMap<Key, T> &other) const { return d == other.d; }
void clear();
diff --git a/src/corelib/tools/qrefcount.h b/src/corelib/tools/qrefcount.h
index 84314b1fcc..3a8f0f3982 100644
--- a/src/corelib/tools/qrefcount.h
+++ b/src/corelib/tools/qrefcount.h
@@ -55,8 +55,10 @@ class RefCount
public:
inline bool ref() Q_DECL_NOTHROW {
int count = atomic.load();
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
return false;
+#endif
if (count != -1) // !isStatic
atomic.ref();
return true;
@@ -64,13 +66,16 @@ public:
inline bool deref() Q_DECL_NOTHROW {
int count = atomic.load();
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
if (count == 0) // !isSharable
return false;
+#endif
if (count == -1) // isStatic
return true;
return atomic.deref();
}
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
bool setSharable(bool sharable) Q_DECL_NOTHROW
{
Q_ASSERT(!isShared());
@@ -80,17 +85,18 @@ public:
return atomic.testAndSetRelaxed(1, 0);
}
- bool isStatic() const Q_DECL_NOTHROW
- {
- // Persistent object, never deleted
- return atomic.load() == -1;
- }
-
bool isSharable() const Q_DECL_NOTHROW
{
// Sharable === Shared ownership.
return atomic.load() != 0;
}
+#endif
+
+ bool isStatic() const Q_DECL_NOTHROW
+ {
+ // Persistent object, never deleted
+ return atomic.load() == -1;
+ }
bool isShared() const Q_DECL_NOTHROW
{
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h
index ad2f91b983..0cc704b6cf 100644
--- a/src/corelib/tools/qset.h
+++ b/src/corelib/tools/qset.h
@@ -91,7 +91,9 @@ public:
inline void detach() { q_hash.detach(); }
inline bool isDetached() const { return q_hash.isDetached(); }
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable) { q_hash.setSharable(sharable); }
+#endif
inline void clear() { q_hash.clear(); }
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 79365b11b1..aac9c493c3 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -4331,14 +4331,6 @@ QByteArray QString::toLocal8Bit_helper(const QChar *data, int size)
UTF-8 is a Unicode codec and can represent all characters in a Unicode
string like QString.
- However, in the Unicode range, there are certain codepoints that are not
- considered characters. The Unicode standard reserves the last two
- codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF,
- U+2FFFE, etc.), as well as 32 codepoints in the range U+FDD0..U+FDEF,
- inclusive, as non-characters. If any of those appear in the string, they
- may be discarded and will not appear in the UTF-8 representation, or they
- may be replaced by one or more replacement characters.
-
\sa fromUtf8(), toLatin1(), toLocal8Bit(), QTextCodec
*/
@@ -4493,10 +4485,10 @@ QString QString::fromLocal8Bit_helper(const char *str, int size)
sequences, non-characters, overlong sequences or surrogate codepoints
encoded into UTF-8.
- Non-characters are codepoints that the Unicode standard reserves and must
- not be used in text interchange. They are the last two codepoints in each
- Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF, U+2FFFE, etc.), as well
- as 32 codepoints in the range U+FDD0..U+FDEF, inclusive.
+ This function can be used to process incoming data incrementally as long as
+ all UTF-8 characters are terminated within the incoming data. Any
+ unterminated characters at the end of the string will be replaced or
+ suppressed. In order to do stateful decoding, please use \l QTextDecoder.
\sa toUtf8(), fromLatin1(), fromLocal8Bit()
*/
@@ -9517,14 +9509,6 @@ QByteArray QStringRef::toLocal8Bit() const
UTF-8 is a Unicode codec and can represent all characters in a Unicode
string like QString.
- However, in the Unicode range, there are certain codepoints that are not
- considered characters. The Unicode standard reserves the last two
- codepoints in each Unicode Plane (U+FFFE, U+FFFF, U+1FFFE, U+1FFFF,
- U+2FFFE, etc.), as well as 16 codepoints in the range U+FDD0..U+FDDF,
- inclusive, as non-characters. If any of those appear in the string, they
- may be discarded and will not appear in the UTF-8 representation, or they
- may be replaced by one or more replacement characters.
-
\sa toLatin1(), toLocal8Bit(), QTextCodec
*/
QByteArray QStringRef::toUtf8() const
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index b0be98c296..6f7c534085 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -107,6 +107,7 @@ public:
inline void detach();
inline bool isDetached() const { return !d->ref.isShared(); }
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
inline void setSharable(bool sharable)
{
if (sharable == d->ref.isSharable())
@@ -122,6 +123,7 @@ public:
}
Q_ASSERT(d->ref.isSharable() == sharable);
}
+#endif
inline bool isSharedWith(const QVector<T> &other) const { return d == other.d; }
@@ -329,10 +331,12 @@ template <typename T>
void QVector<T>::detach()
{
if (!isDetached()) {
- if (d->alloc)
- reallocData(d->size, int(d->alloc));
- else
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
+ if (!d->alloc)
d = Data::unsharableEmpty();
+ else
+#endif
+ reallocData(d->size, int(d->alloc));
}
Q_ASSERT(isDetached());
}
@@ -484,7 +488,9 @@ void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::Allo
x = Data::allocate(aalloc, options);
Q_CHECK_PTR(x);
// aalloc is bigger then 0 so it is not [un]sharedEmpty
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
Q_ASSERT(x->ref.isSharable() || options.testFlag(QArrayData::Unsharable));
+#endif
Q_ASSERT(!x->ref.isStatic());
x->size = asize;
@@ -550,7 +556,9 @@ void QVector<T>::reallocData(const int asize, const int aalloc, QArrayData::Allo
Q_ASSERT(d->data());
Q_ASSERT(uint(d->size) <= d->alloc);
+#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
Q_ASSERT(d != Data::unsharableEmpty());
+#endif
Q_ASSERT(aalloc ? d != Data::sharedNull() : d == Data::sharedNull());
Q_ASSERT(d->alloc >= uint(aalloc));
Q_ASSERT(d->size == asize);