diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h index 94182a531c..a2d9901677 100644 --- a/src/corelib/tools/qarraydata.h +++ b/src/corelib/tools/qarraydata.h @@ -109,7 +109,11 @@ struct Q_CORE_EXPORT QArrayData return result; } - Q_REQUIRED_RESULT static QArrayData *allocate(size_t objectSize, size_t alignment, + Q_REQUIRED_RESULT +#if defined(Q_CC_GNU) + __attribute__((__malloc__)) +#endif + static QArrayData *allocate(size_t objectSize, size_t alignment, size_t capacity, AllocationOptions options = Default) noexcept; Q_REQUIRED_RESULT static QArrayData *reallocateUnaligned(QArrayData *data, size_t objectSize, size_t newCapacity, AllocationOptions newOptions = Default) noexcept;