Compile with !QT_SUPPORTS(UNSHARABLE_CONTAINERS)

'Unsharable' isn't available, then.

Change-Id: Ifab3b2306379c651bfcd8381836a8f7eadbdc6d6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2015-07-06 22:21:04 +02:00
parent 521ad6048f
commit 712d605c43
2 changed files with 6 additions and 0 deletions

View File

@ -103,7 +103,11 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment,
quintptr data = (quintptr(header) + sizeof(QArrayData) + alignment - 1)
& ~(alignment - 1);
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
header->ref.atomic.store(bool(!(options & Unsharable)));
#else
header->ref.atomic.store(1);
#endif
header->size = 0;
header->alloc = capacity;
header->capacityReserved = bool(options & CapacityReserved);

View File

@ -249,11 +249,13 @@ struct QTypedArrayData
return allocate(/* capacity */ 0);
}
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
static QTypedArrayData *unsharableEmpty()
{
Q_STATIC_ASSERT(sizeof(QTypedArrayData) == sizeof(QArrayData));
return allocate(/* capacity */ 0, Unsharable);
}
#endif
};
template <class T, size_t N>