summaryrefslogtreecommitdiff
path: root/ACE/ace/OS_Memory.h
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2021-06-06 18:12:33 +0200
committerJohnny Willemsen <jwillemsen@remedy.nl>2021-06-06 18:12:33 +0200
commit54f5383fa3c74268081cdaa306d793935b40a658 (patch)
treedf4ce12dba37018ea8a0d016da39605bdc0bf7ae /ACE/ace/OS_Memory.h
parent0dc692d9bb9744d921361e655ad8a7d46c1daf16 (diff)
downloadATCD-54f5383fa3c74268081cdaa306d793935b40a658.tar.gz
Instead of ACE_throw_bad_alloc throw std::badalloc directly
* ACE/ace/Bound_Ptr.inl: * ACE/ace/Future.cpp: * ACE/ace/OS_Memory.h: * ACE/ace/Refcounted_Auto_Ptr.inl: * ACE/ace/Svc_Handler.cpp:
Diffstat (limited to 'ACE/ace/OS_Memory.h')
-rw-r--r--ACE/ace/OS_Memory.h27
1 files changed, 1 insertions, 26 deletions
diff --git a/ACE/ace/OS_Memory.h b/ACE/ace/OS_Memory.h
index d70bddc27aa..b5403ec3b20 100644
--- a/ACE/ace/OS_Memory.h
+++ b/ACE/ace/OS_Memory.h
@@ -75,32 +75,7 @@ ACE_END_VERSIONED_NAMESPACE_DECL
#define ACE_nothrow std::nothrow
#define ACE_nothrow_t std::nothrow_t
#define ACE_del_bad_alloc
-
-// Since new() throws exceptions, we need a way to avoid passing
-// exceptions past the call to new because ACE counts on having a 0
-// return value for a failed allocation. Some compilers offer the
-// new (nothrow) version, which does exactly what we want. Others
-// do not. For those that do not, this sets up what exception is thrown,
-// and then below we'll do a try/catch around the new to catch it and
-// return a 0 pointer instead.
-# if defined (__HP_aCC)
-# define ACE_throw_bad_alloc throw ACE_bad_alloc ()
-# elif defined (__SUNPRO_CC)
-# define ACE_throw_bad_alloc throw ACE_bad_alloc ()
-# elif defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB)
-# if defined (ACE_HAS_MFC) && (ACE_HAS_MFC == 1)
-# define ACE_throw_bad_alloc AfxThrowMemoryException ()
-# else
-# define ACE_throw_bad_alloc throw ACE_bad_alloc ()
-# endif
-# else
- // MFC changes the behavior of operator new at all MSVC versions from 6 up.
-# if defined (ACE_HAS_MFC) && (ACE_HAS_MFC == 1)
-# define ACE_throw_bad_alloc AfxThrowMemoryException ()
-# else
-# define ACE_throw_bad_alloc throw ACE_bad_alloc ()
-# endif
-# endif /* __HP_aCC */
+#define ACE_throw_bad_alloc throw std::bad_alloc ()
#define ACE_NEW_RETURN(POINTER,CONSTRUCTOR,RET_VAL) \
do { POINTER = new (std::nothrow) CONSTRUCTOR; \