From 9592b98b55c1bc716d202d4bcd82c79bc20300cd Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 19 Jan 2013 09:43:20 +0800 Subject: Mark the QArrayData alloc/dealloc functions as nothrow Throwing is handled at a higher level. Change-Id: I573e4ded135b61e35fbe6e188be09acf449911fc Reviewed-by: Marc Mutz --- src/corelib/tools/qarraydata.cpp | 4 ++-- src/corelib/tools/qarraydata.h | 4 ++-- src/corelib/tools/qbytearray.cpp | 2 +- src/corelib/tools/qtools_p.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qarraydata.cpp b/src/corelib/tools/qarraydata.cpp index 825b3289c7..45587b1214 100644 --- a/src/corelib/tools/qarraydata.cpp +++ b/src/corelib/tools/qarraydata.cpp @@ -68,7 +68,7 @@ static const QArrayData &qt_array_empty = qt_array[0]; static const QArrayData &qt_array_unsharable_empty = qt_array[1]; QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment, - size_t capacity, AllocationOptions options) + size_t capacity, AllocationOptions options) Q_DECL_NOTHROW { // Alignment is a power of two Q_ASSERT(alignment >= Q_ALIGNOF(QArrayData) @@ -111,7 +111,7 @@ QArrayData *QArrayData::allocate(size_t objectSize, size_t alignment, } void QArrayData::deallocate(QArrayData *data, size_t objectSize, - size_t alignment) + size_t alignment) Q_DECL_NOTHROW { // Alignment is a power of two Q_ASSERT(alignment >= Q_ALIGNOF(QArrayData) diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h index 7df4694bcd..90b5649f09 100644 --- a/src/corelib/tools/qarraydata.h +++ b/src/corelib/tools/qarraydata.h @@ -116,9 +116,9 @@ struct Q_CORE_EXPORT QArrayData static QArrayData *allocate(size_t objectSize, size_t alignment, size_t capacity, AllocationOptions options = Default) - Q_REQUIRED_RESULT; + Q_DECL_NOTHROW Q_REQUIRED_RESULT; static void deallocate(QArrayData *data, size_t objectSize, - size_t alignment); + size_t alignment) Q_DECL_NOTHROW; static const QArrayData shared_null[2]; static QArrayData *sharedNull() { return const_cast(shared_null); } diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 304ce69449..3030657a62 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -67,7 +67,7 @@ int qFindByteArray( const char *needle0, int needleLen); -int qAllocMore(int alloc, int extra) +int qAllocMore(int alloc, int extra) Q_DECL_NOTHROW { Q_ASSERT(alloc >= 0 && extra >= 0); Q_ASSERT_X(alloc < (1 << 30) - extra, "qAllocMore", "Requested size is too large!"); diff --git a/src/corelib/tools/qtools_p.h b/src/corelib/tools/qtools_p.h index b00343dd39..38073a6e30 100644 --- a/src/corelib/tools/qtools_p.h +++ b/src/corelib/tools/qtools_p.h @@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE // implemented in qbytearray.cpp -int Q_CORE_EXPORT qAllocMore(int alloc, int extra); +int Q_CORE_EXPORT qAllocMore(int alloc, int extra) Q_DECL_NOTHROW; QT_END_NAMESPACE -- cgit v1.2.3