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:
parent
521ad6048f
commit
712d605c43
@ -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);
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user