all: misc and noexcept updates
This commit is contained in:
@@ -49,7 +49,7 @@ protected:
|
||||
|
||||
public:
|
||||
inline MemBufferBase() noexcept : ptr(nullptr), size_in_bytes(0) {}
|
||||
inline ~MemBufferBase() noexcept {}
|
||||
forceinline ~MemBufferBase() noexcept {}
|
||||
|
||||
// IMPORTANT NOTE: automatic conversion to underlying pointer
|
||||
// HINT: for fully bound-checked pointer use XSPAN_S from xspan.h
|
||||
@@ -213,8 +213,8 @@ private:
|
||||
MemBuffer(const MemBuffer &) DELETED_FUNCTION;
|
||||
MemBuffer &operator=(const MemBuffer &) DELETED_FUNCTION;
|
||||
#if __cplusplus >= 201103L
|
||||
MemBuffer(MemBuffer &&) DELETED_FUNCTION;
|
||||
MemBuffer &operator=(MemBuffer &&) DELETED_FUNCTION;
|
||||
MemBuffer(MemBuffer &&) noexcept DELETED_FUNCTION;
|
||||
MemBuffer &operator=(MemBuffer &&) noexcept DELETED_FUNCTION;
|
||||
#endif
|
||||
// disable dynamic allocation
|
||||
ACC_CXX_DISABLE_NEW_DELETE
|
||||
|
||||
+1
-2
@@ -27,8 +27,6 @@
|
||||
|
||||
#include "../headers.h"
|
||||
#include <algorithm>
|
||||
#include "../conf.h"
|
||||
|
||||
#define ACC_WANT_ACC_INCI_H 1
|
||||
#include "../miniacc.h"
|
||||
#define ACC_WANT_ACCLIB_GETOPT 1
|
||||
@@ -38,6 +36,7 @@
|
||||
#define ACC_WANT_ACCLIB_WILDARGV 1
|
||||
#undef HAVE_MKDIR
|
||||
#include "../miniacc.h"
|
||||
#include "../conf.h"
|
||||
|
||||
/*************************************************************************
|
||||
// assert sane memory buffer sizes to protect against integer overflows
|
||||
|
||||
@@ -101,7 +101,13 @@ forceinline void assertInvariants() const noexcept {}
|
||||
|
||||
public:
|
||||
#if DEBUG
|
||||
inline ~CSelf() { invalidate(); }
|
||||
~CSelf() noexcept {
|
||||
try {
|
||||
invalidate();
|
||||
} catch (...) {
|
||||
std::terminate();
|
||||
}
|
||||
}
|
||||
#else
|
||||
forceinline ~CSelf() noexcept {}
|
||||
#endif
|
||||
|
||||
@@ -63,9 +63,15 @@ public:
|
||||
#endif
|
||||
|
||||
#if DEBUG
|
||||
inline ~CSelf() { invalidate(); }
|
||||
~CSelf() noexcept {
|
||||
try {
|
||||
invalidate();
|
||||
} catch (...) {
|
||||
std::terminate();
|
||||
}
|
||||
}
|
||||
#else
|
||||
inline ~CSelf() noexcept {}
|
||||
forceinline ~CSelf() noexcept {}
|
||||
#endif
|
||||
noinline void invalidate() {
|
||||
assertInvariants();
|
||||
|
||||
Reference in New Issue
Block a user