5#include <QtCore/qarraydata.h>
6#include <QtCore/private/qnumeric_p.h>
7#include <QtCore/private/qtools_p.h>
8#include <QtCore/qmath.h>
10#include <QtCore/qbytearray.h>
11#include <QtCore/qstring.h>
100 bytes += (morebytes - bytes) / 2;
125 if (objectSize <= FooterSize)
141 header->ref_.storeRelaxed(1);
149struct AllocationResult {
156static inline AllocationResult
182 void *
data =
nullptr;
225std::pair<QArrayData *, void *>
239 ?
reinterpret_cast<char *
>(dataPointer) -
reinterpret_cast<char *
>(
data)
247 dataPointer =
reinterpret_cast<char *
>(
header) +
offset;
249 dataPointer =
nullptr;
251 return {
header, dataPointer};
Combined button and popup list for selecting options.
static CalculateGrowingBlockSizeResult calculateBlockSize(qsizetype capacity, qsizetype objectSize, qsizetype headerSize, QArrayData::AllocationOption option)
static QArrayData * allocateData(qsizetype allocSize)
QT_BEGIN_NAMESPACE qsizetype qCalculateBlockSize(qsizetype elementCount, qsizetype elementSize, qsizetype headerSize) noexcept
CalculateGrowingBlockSizeResult qCalculateGrowingBlockSize(qsizetype elementCount, qsizetype elementSize, qsizetype headerSize) noexcept
static AllocationResult allocateHelper(qsizetype objectSize, qsizetype alignment, qsizetype capacity, QArrayData::AllocationOption option) noexcept
static QString header(const QString &name)
static const qint64 headerSize
constexpr quint32 qNextPowerOfTwo(quint32 v)
constexpr const T & qMax(const T &a, const T &b)
std::enable_if_t< std::is_unsigned_v< T >, bool > qAddOverflow(T v1, T v2, T *r)
std::enable_if_t< std::is_unsigned_v< T >||std::is_signed_v< T >, bool > qMulOverflow(T v1, T v2, T *r)
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
unsigned long long quint64
static Q_CORE_EXPORT std::pair< QArrayData *, void * > reallocateUnaligned(QArrayData *data, void *dataPointer, qsizetype objectSize, qsizetype newCapacity, AllocationOption option) noexcept
static Q_DECL_MALLOCLIKE Q_CORE_EXPORT void * allocate(QArrayData **pdata, qsizetype objectSize, qsizetype alignment, qsizetype capacity, AllocationOption option=QArrayData::KeepSize) noexcept
static Q_CORE_EXPORT void deallocate(QArrayData *data, qsizetype objectSize, qsizetype alignment) noexcept
static Q_DECL_MALLOCLIKE Q_CORE_EXPORT void * allocate2(QArrayData **pdata, qsizetype capacity, AllocationOption option=QArrayData::KeepSize) noexcept
static Q_DECL_MALLOCLIKE Q_CORE_EXPORT void * allocate1(QArrayData **pdata, qsizetype capacity, AllocationOption option=QArrayData::KeepSize) noexcept
static T * dataStart(QArrayData *data, qsizetype alignment) noexcept