summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-04-19 23:59:22 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-04-19 23:59:22 +0300
commitd25fee545bcf270231bfe5a683fa61d5ae795338 (patch)
tree018648fe593bf1d4b5ca3ebb132fa9251f750060
parentaaa432bc82d224955ebcbfaa67373b1d869e725c (diff)
downloadbdwgc-d25fee545bcf270231bfe5a683fa61d5ae795338.tar.gz
Specify throw and noexcept for operator new/delete in gc_cpp.h for MS VC
(fix of commit eb571cb86) * include/gc/gc_cpp.h [GC_NO_INLINE_STD_NEW && _MSC_VER && GC_OPERATOR_NEW_ARRAY] (operator new[]): Add GC_DECL_NEW_THROW. * include/gc/gc_cpp.h [GC_NO_INLINE_STD_NEW && _MSC_VER] (operator new): Likewise. * include/gc/gc_cpp.h [GC_NO_INLINE_STD_NEW && _MSC_VER && GC_OPERATOR_NEW_ARRAY] (operator delete[]): Add GC_NOEXCEPT. * include/gc/gc_cpp.h [GC_NO_INLINE_STD_NEW && _MSC_VER] (operator delete): Likewise. * include/gc/gc_cpp.h [GC_NO_INLINE_STD_NEW && _MSC_VER && GC_OPERATOR_NEW_ARRAY] (operator new[](size_t,int,const char*,int)): New prototype.
-rw-r--r--include/gc/gc_cpp.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/gc/gc_cpp.h b/include/gc/gc_cpp.h
index ea05989e..2976d61a 100644
--- a/include/gc/gc_cpp.h
+++ b/include/gc/gc_cpp.h
@@ -384,12 +384,15 @@ inline void* operator new(GC_SIZE_T, GC_NS_QUALIFY(GCPlacement),
// There seems to be no way to redirect new in this environment without
// including this everywhere.
# ifdef GC_OPERATOR_NEW_ARRAY
- void* operator new[](GC_SIZE_T);
- void operator delete[](void*);
-# endif
+ void* operator new[](GC_SIZE_T) GC_DECL_NEW_THROW;
+ void operator delete[](void*) GC_NOEXCEPT;
+
+ void* operator new[](GC_SIZE_T, int /* nBlockUse */,
+ const char* /* szFileName */, int /* nLine */);
+# endif // GC_OPERATOR_NEW_ARRAY
- void* operator new(GC_SIZE_T);
- void operator delete(void*);
+ void* operator new(GC_SIZE_T) GC_DECL_NEW_THROW;
+ void operator delete(void*) GC_NOEXCEPT;
void* operator new(GC_SIZE_T, int /* nBlockUse */,
const char* /* szFileName */, int /* nLine */);