diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2021-06-06 10:29:02 +0200 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2021-06-06 10:29:02 +0200 |
commit | 1652ce786e3f76875cfa9008ac83682c4828d6a6 (patch) | |
tree | ba10965bec481728ad3c3c1744801124776d59ae | |
parent | cb68090e23b22ae8c3312955d9cd2d3fd957db3c (diff) | |
download | ATCD-1652ce786e3f76875cfa9008ac83682c4828d6a6.tar.gz |
All compilers we support provide ACE_HAS_NEW_NOTHROW
* ACE/ace/CORBA_macros.h:
* ACE/ace/OS_Memory.h:
* ACE/ace/README:
* ACE/ace/Svc_Handler.cpp:
* ACE/ace/Svc_Handler.h:
* ACE/ace/config-all.h:
* ACE/ace/config-g++-common.h:
* ACE/ace/config-hpux-11.00.h:
* ACE/ace/config-lynxos.h:
* ACE/ace/config-sunos5.5.h:
* ACE/ace/config-win32-borland.h:
* ACE/ace/config-win32-msvc-14.h:
* ACE/examples/DLL/Newsweek.cpp:
* ACE/examples/DLL/Newsweek.h:
* ACE/examples/DLL/Today.cpp:
* ACE/examples/DLL/Today.h:
* ACE/examples/Shared_Malloc/test_persistence.cpp:
* ACE/tests/DLL_Test_Impl.cpp:
* ACE/tests/DLL_Test_Impl.h:
* ACE/tests/Dynamic_Test.cpp:
* TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp:
* TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.cpp:
* TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp:
* TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp:
* TAO/tao/Var_Size_Argument_T.cpp:
* TAO/tests/POA/DSI/Database_i.cpp:
* TAO/tests/POA/DSI/Database_i.h:
27 files changed, 26 insertions, 133 deletions
diff --git a/ACE/ace/CORBA_macros.h b/ACE/ace/CORBA_macros.h index e6eef8856fc..06da1889ace 100644 --- a/ACE/ace/CORBA_macros.h +++ b/ACE/ace/CORBA_macros.h @@ -41,22 +41,11 @@ # define ACE_del_bad_alloc #endif -#if defined (ACE_HAS_NEW_NOTHROW) - -# define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { POINTER = new (ACE_nothrow) CONSTRUCTOR; \ - if (POINTER == 0) { throw EXCEPTION; } \ +#define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \ + do { POINTER = new (ACE_nothrow) CONSTRUCTOR; \ + if (POINTER == 0) { throw EXCEPTION; } \ } while (0) -# else - -# define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \ - do { try { POINTER = new CONSTRUCTOR; } \ - catch (ACE_bad_alloc) { ACE_del_bad_alloc throw EXCEPTION; } \ - } while (0) - -# endif /* ACE_HAS_NEW_NOTHROW */ - // FUZZ: disable check_for_ACE_Guard # define ACE_GUARD_THROW_EX(MUTEX,OBJ,LOCK,EXCEPTION) \ ACE_Guard< MUTEX > OBJ (LOCK); \ diff --git a/ACE/ace/OS_Memory.h b/ACE/ace/OS_Memory.h index 7613081a905..f4bf3fe93f3 100644 --- a/ACE/ace/OS_Memory.h +++ b/ACE/ace/OS_Memory.h @@ -129,15 +129,13 @@ ACE_END_VERSIONED_NAMESPACE_DECL # else # include /**/ <new> # define ACE_bad_alloc ::std::bad_alloc -# if defined (ACE_HAS_NEW_NOTHROW) -# if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) -# define ACE_nothrow ::std::nothrow -# define ACE_nothrow_t ::std::nothrow_t -# else -# define ACE_nothrow nothrow -# define ACE_nothrow_t nothrow_t -# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ -# endif /* ACE_HAS_NEW_NOTHROW */ +# if defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) +# define ACE_nothrow ::std::nothrow +# define ACE_nothrow_t ::std::nothrow_t +# else +# define ACE_nothrow nothrow +# define ACE_nothrow_t nothrow_t +# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ # define ACE_throw_bad_alloc throw ACE_bad_alloc () # endif /* __SUNPRO_CC < 0x500 */ # elif defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) @@ -168,38 +166,19 @@ ACE_END_VERSIONED_NAMESPACE_DECL # endif # endif /* __HP_aCC */ -# if defined (ACE_HAS_NEW_NOTHROW) -# define ACE_NEW_RETURN(POINTER,CONSTRUCTOR,RET_VAL) \ +#define ACE_NEW_RETURN(POINTER,CONSTRUCTOR,RET_VAL) \ do { POINTER = new (ACE_nothrow) CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; return RET_VAL; } \ } while (0) -# define ACE_NEW(POINTER,CONSTRUCTOR) \ +#define ACE_NEW(POINTER,CONSTRUCTOR) \ do { POINTER = new(ACE_nothrow) CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; return; } \ } while (0) -# define ACE_NEW_NORETURN(POINTER,CONSTRUCTOR) \ +#define ACE_NEW_NORETURN(POINTER,CONSTRUCTOR) \ do { POINTER = new(ACE_nothrow) CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; } \ } while (0) -# else - -# define ACE_NEW_RETURN(POINTER,CONSTRUCTOR,RET_VAL) \ - do { try { POINTER = new CONSTRUCTOR; } \ - catch (ACE_bad_alloc) { ACE_del_bad_alloc errno = ENOMEM; POINTER = 0; return RET_VAL; } \ - } while (0) - -# define ACE_NEW(POINTER,CONSTRUCTOR) \ - do { try { POINTER = new CONSTRUCTOR; } \ - catch (ACE_bad_alloc) { ACE_del_bad_alloc errno = ENOMEM; POINTER = 0; return; } \ - } while (0) - -# define ACE_NEW_NORETURN(POINTER,CONSTRUCTOR) \ - do { try { POINTER = new CONSTRUCTOR; } \ - catch (ACE_bad_alloc) { ACE_del_bad_alloc errno = ENOMEM; POINTER = 0; } \ - } while (0) -# endif /* ACE_HAS_NEW_NOTHROW */ - ACE_BEGIN_VERSIONED_NAMESPACE_DECL //@{ /** diff --git a/ACE/ace/README b/ACE/ace/README index 0367fbefdc0..59c493a026e 100644 --- a/ACE/ace/README +++ b/ACE/ace/README @@ -354,7 +354,6 @@ ACE_HAS_MT_SAFE_MKTIME Platform supports MT safe ACE_HAS_MUTEX_TIMEOUTS Compiler supports timed mutex acquisitions (e.g. pthread_mutex_timedlock()). -ACE_HAS_NEW_NOTHROW Compiler offers new (nothrow). ACE_HAS_NONCONST_CHDIR Platform uses non-const char * in call to chdir ACE_HAS_NONCONST_CLOCK_SETTIME Platform uses non-const diff --git a/ACE/ace/Svc_Handler.cpp b/ACE/ace/Svc_Handler.cpp index c5830ed950c..5d424969ea2 100644 --- a/ACE/ace/Svc_Handler.cpp +++ b/ACE/ace/Svc_Handler.cpp @@ -54,7 +54,6 @@ ACE_Svc_Handler<PEER_STREAM, SYNCH_TRAITS>::operator new (size_t n) } } -#if defined (ACE_HAS_NEW_NOTHROW) template <typename PEER_STREAM, typename SYNCH_TRAITS> void * ACE_Svc_Handler<PEER_STREAM, SYNCH_TRAITS>::operator new (size_t n, const ACE_nothrow_t&) throw() @@ -90,8 +89,6 @@ ACE_Svc_Handler<PEER_STREAM, SYNCH_TRAITS>::operator delete (void *p, ::delete [] static_cast <char *> (p); } -#endif /* ACE_HAS_NEW_NOTHROW */ - template <typename PEER_STREAM, typename SYNCH_TRAITS> void ACE_Svc_Handler<PEER_STREAM, SYNCH_TRAITS>::destroy () { diff --git a/ACE/ace/Svc_Handler.h b/ACE/ace/Svc_Handler.h index a02ac24c15a..9fb174e16b6 100644 --- a/ACE/ace/Svc_Handler.h +++ b/ACE/ace/Svc_Handler.h @@ -170,14 +170,12 @@ public: /// dynamically. void *operator new (size_t n); -#if defined (ACE_HAS_NEW_NOTHROW) /// Overloaded new operator, nothrow_t variant. Unobtrusively records if a /// <Svc_Handler> is allocated dynamically, which allows it to clean /// itself up correctly whether or not it's allocated statically or /// dynamically. void *operator new (size_t n, const ACE_nothrow_t&) throw(); void operator delete (void *p, const ACE_nothrow_t&) throw (); -#endif /// This operator permits "placement new" on a per-object basis. void * operator new (size_t n, void *p); diff --git a/ACE/ace/config-all.h b/ACE/ace/config-all.h index b36a1554cfd..c14f89c2a93 100644 --- a/ACE/ace/config-all.h +++ b/ACE/ace/config-all.h @@ -88,6 +88,12 @@ # define ACE_NEW_THROWS_EXCEPTIONS #endif /* ACE_NEW_THROWS_EXCEPTIONS */ +// Define ACE_HAS_NEW_NOTHROW for all compilers, we +// except all compilers to support this +#if !defined (ACE_HAS_NEW_NOTHROW) +# define ACE_HAS_NEW_NOTHROW +#endif /* ACE_HAS_NEW_NOTHROW */ + // These includes are here to avoid circular dependencies. // Keep this at the bottom of the file. It contains the main macros. #include "ace/OS_main.h" diff --git a/ACE/ace/config-g++-common.h b/ACE/ace/config-g++-common.h index 2c485720032..6ae80087860 100644 --- a/ACE/ace/config-g++-common.h +++ b/ACE/ace/config-g++-common.h @@ -18,7 +18,6 @@ #define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 #define ACE_TEMPLATES_REQUIRE_SOURCE #define ACE_EXPLICIT_TEMPLATE_DESTRUCTOR_TAKES_ARGS -#define ACE_HAS_NEW_NOTHROW #if __cplusplus >= 201103L # define ACE_HAS_CPP11 diff --git a/ACE/ace/config-hpux-11.00.h b/ACE/ace/config-hpux-11.00.h index fbfa200f34f..d772389e349 100644 --- a/ACE/ace/config-hpux-11.00.h +++ b/ACE/ace/config-hpux-11.00.h @@ -47,10 +47,6 @@ // Platform lacks streambuf "linebuffered ()". # define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 -// Compiler's 'new' throws exceptions on failure, regardless of whether or -// not exception handling is enabled in the compiler options. Fortunately, -// new(nothrow_t) is offered. -# define ACE_HAS_NEW_NOTHROW # define ACE_HAS_NEW_NO_H 1 // Compiler's template mechanism must see source code (i.e., .C files). diff --git a/ACE/ace/config-lynxos.h b/ACE/ace/config-lynxos.h index e2f6a3f93c6..b45bc08388d 100644 --- a/ACE/ace/config-lynxos.h +++ b/ACE/ace/config-lynxos.h @@ -55,7 +55,6 @@ #define ACE_HAS_MKDIR #define ACE_HAS_MSG #define ACE_HAS_NANOSLEEP -#define ACE_HAS_NEW_NOTHROW #define ACE_HAS_NONCONST_CLOCK_SETTIME #define ACE_HAS_NONCONST_MSGSND #define ACE_HAS_NONCONST_READV diff --git a/ACE/ace/config-sunos5.5.h b/ACE/ace/config-sunos5.5.h index 4861a626e56..e87605431c1 100644 --- a/ACE/ace/config-sunos5.5.h +++ b/ACE/ace/config-sunos5.5.h @@ -46,7 +46,6 @@ # define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 # define ACE_HAS_THR_C_DEST # endif /* __SUNPRO_CC_COMPAT >= 5 */ -# define ACE_HAS_NEW_NOTHROW # endif /* __SUNPRO_CC >= 0x500 */ # endif /* __SUNPRO_CC >= 0x420 */ diff --git a/ACE/ace/config-win32-borland.h b/ACE/ace/config-win32-borland.h index f10fc79a119..a5c315aa256 100644 --- a/ACE/ace/config-win32-borland.h +++ b/ACE/ace/config-win32-borland.h @@ -122,7 +122,6 @@ #define ACE_HAS_USER_MODE_MASKS 1 #define ACE_LACKS_ACE_IOSTREAM 1 #define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 -#define ACE_HAS_NEW_NOTHROW #define ACE_TEMPLATES_REQUIRE_SOURCE 1 #if defined (ACE_HAS_BCC32) # define ACE_UINT64_FORMAT_SPECIFIER_ASCII "%Lu" diff --git a/ACE/ace/config-win32-msvc-14.h b/ACE/ace/config-win32-msvc-14.h index 524be571e4c..01f73c6f863 100644 --- a/ACE/ace/config-win32-msvc-14.h +++ b/ACE/ace/config-win32-msvc-14.h @@ -92,8 +92,6 @@ # define ACE_LACKS_ACE_IOSTREAM # endif /* ! ACE_USES_OLD_IOSTREAMS */ -#define ACE_HAS_NEW_NOTHROW - #else // iostream header lacks ipfx (), isfx (), etc., declarations diff --git a/ACE/examples/DLL/Newsweek.cpp b/ACE/examples/DLL/Newsweek.cpp index f93c57acf01..34df2b16113 100644 --- a/ACE/examples/DLL/Newsweek.cpp +++ b/ACE/examples/DLL/Newsweek.cpp @@ -18,7 +18,6 @@ Newsweek::operator new (size_t bytes) { return ::new char[bytes]; } -#if defined (ACE_HAS_NEW_NOTHROW) void * Newsweek::operator new (size_t bytes, const ACE_nothrow_t&) { @@ -29,7 +28,6 @@ Newsweek::operator delete (void *p, const ACE_nothrow_t&) throw () { delete [] static_cast <char *> (p); } -#endif void Newsweek::operator delete (void *ptr) { diff --git a/ACE/examples/DLL/Newsweek.h b/ACE/examples/DLL/Newsweek.h index 32124b6a04c..e5845056107 100644 --- a/ACE/examples/DLL/Newsweek.h +++ b/ACE/examples/DLL/Newsweek.h @@ -41,11 +41,9 @@ public: // created/deleted using the memory allocator associated with the // DLL/SO. void *operator new (size_t bytes); -#if defined (ACE_HAS_NEW_NOTHROW) // Overloaded new operator, nothrow_t variant. void *operator new (size_t bytes, const ACE_nothrow_t&); void operator delete (void *p, const ACE_nothrow_t&) throw (); -#endif void operator delete (void *ptr); }; diff --git a/ACE/examples/DLL/Today.cpp b/ACE/examples/DLL/Today.cpp index 78dc766ce1f..da2f5e9256e 100644 --- a/ACE/examples/DLL/Today.cpp +++ b/ACE/examples/DLL/Today.cpp @@ -19,7 +19,6 @@ Today::operator new (size_t bytes) { return ::new char[bytes]; } -#if defined (ACE_HAS_NEW_NOTHROW) void * Today::operator new (size_t bytes, const ACE_nothrow_t&) { @@ -30,7 +29,6 @@ Today::operator delete (void *p, const ACE_nothrow_t&) throw () { delete [] static_cast <char *> (p); } -#endif void Today::operator delete (void *ptr) { diff --git a/ACE/examples/DLL/Today.h b/ACE/examples/DLL/Today.h index 8a74299420d..48711a3d993 100644 --- a/ACE/examples/DLL/Today.h +++ b/ACE/examples/DLL/Today.h @@ -42,11 +42,9 @@ public: // created/deleted using the memory allocator associated with the // DLL/SO. void *operator new (size_t bytes); -#if defined (ACE_HAS_NEW_NOTHROW) // Overloaded new operator, nothrow_t variant. void *operator new (size_t bytes, const ACE_nothrow_t&); void operator delete (void *p, const ACE_nothrow_t&) throw (); -#endif void operator delete (void *ptr); }; diff --git a/ACE/examples/Shared_Malloc/test_persistence.cpp b/ACE/examples/Shared_Malloc/test_persistence.cpp index 43007928ccc..87d062a20d9 100644 --- a/ACE/examples/Shared_Malloc/test_persistence.cpp +++ b/ACE/examples/Shared_Malloc/test_persistence.cpp @@ -59,7 +59,6 @@ public: return shmem_allocator->malloc (sizeof (Employee)); } -#if defined (ACE_HAS_NEW_NOTHROW) void *operator new (size_t, const ACE_nothrow_t&) { return shmem_allocator->malloc (sizeof (Employee)); @@ -68,7 +67,6 @@ public: { shmem_allocator->free (p); } -#endif void operator delete (void *pointer) { diff --git a/ACE/tests/DLL_Test_Impl.cpp b/ACE/tests/DLL_Test_Impl.cpp index 06b093a852d..8d323651131 100644 --- a/ACE/tests/DLL_Test_Impl.cpp +++ b/ACE/tests/DLL_Test_Impl.cpp @@ -52,8 +52,7 @@ Hello_Impl::operator new (size_t bytes) return ::new char[bytes]; } -#if defined (ACE_HAS_NEW_NOTHROW) - /// Overloaded new operator, nothrow_t variant. +/// Overloaded new operator, nothrow_t variant. void * Hello_Impl::operator new (size_t bytes, const ACE_nothrow_t &nt) { @@ -68,8 +67,6 @@ Hello_Impl::operator delete (void *ptr, const ACE_nothrow_t&) throw () ::delete [] static_cast<char *> (ptr); } -#endif /* ACE_HAS_NEW_NOTHROW */ - void Hello_Impl::operator delete (void *ptr) { diff --git a/ACE/tests/DLL_Test_Impl.h b/ACE/tests/DLL_Test_Impl.h index 0ca5c5323d0..4ba42e5763b 100644 --- a/ACE/tests/DLL_Test_Impl.h +++ b/ACE/tests/DLL_Test_Impl.h @@ -50,14 +50,11 @@ public: // DLL/SO. void *operator new (size_t bytes); -#if defined (ACE_HAS_NEW_NOTHROW) /// Overloaded new operator, nothrow_t variant. void *operator new (size_t bytes, const ACE_nothrow_t &nt); void operator delete (void *p, const ACE_nothrow_t&) throw (); -#endif /* ACE_HAS_NEW_NOTHROW */ void operator delete (void *ptr); - }; #endif /* ACE_TESTS_DLL_TEST_IMPL_H */ diff --git a/ACE/tests/Dynamic_Test.cpp b/ACE/tests/Dynamic_Test.cpp index 0ffc523544b..62d7080ea0e 100644 --- a/ACE/tests/Dynamic_Test.cpp +++ b/ACE/tests/Dynamic_Test.cpp @@ -24,11 +24,8 @@ public: void *operator new (size_t n); -#if defined (ACE_HAS_NEW_NOTHROW) void *operator new (size_t n, const ACE_nothrow_t&) throw(); void operator delete (void *p, const ACE_nothrow_t&) throw (); -#endif - void * operator new (size_t n, void *p); void operator delete (void *); @@ -63,7 +60,6 @@ A::operator new (size_t n) } } -#if defined (ACE_HAS_NEW_NOTHROW) void* A::operator new (size_t n, const ACE_nothrow_t&) throw() { @@ -94,8 +90,6 @@ A::operator delete (void *p, const ACE_nothrow_t&) throw() ::delete [] static_cast <char *> (p); } -#endif /* ACE_HAS_NEW_NOTHROW */ - void A::operator delete (void *obj) { diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp index 28445381a2f..3bdab065dc5 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Naming_Server.cpp @@ -689,21 +689,13 @@ TAO_FT_Naming_Server::fini () TAO_Storable_Naming_Context_Factory * TAO_FT_Naming_Server::storable_naming_context_factory (size_t context_size) { -#if defined (ACE_HAS_NEW_NOTHROW) return new (ACE_nothrow) TAO_FT_Storable_Naming_Context_Factory (context_size, this->replicator_); -#else - return new TAO_FT_Storable_Naming_Context_Factory (context_size, this->replicator_); -#endif /* ACE_HAS_NEW_NOTHROW */ } TAO_Persistent_Naming_Context_Factory * TAO_FT_Naming_Server::persistent_naming_context_factory () { -#if defined (ACE_HAS_NEW_NOTHROW) return new (ACE_nothrow) TAO_FT_Persistent_Naming_Context_Factory; -#else - return new TAO_FT_Persistent_Naming_Context_Factory; -#endif /* ACE_HAS_NEW_NOTHROW */ } /// Return the IOR for the registered replication manager diff --git a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.cpp b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.cpp index 5d0fda3837f..66b36bebf29 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/FaultTolerant/FT_Persistent_Naming_Context_Factory.cpp @@ -3,15 +3,15 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL - /// Constructor. +/// Constructor. TAO_FT_Persistent_Naming_Context_Factory::TAO_FT_Persistent_Naming_Context_Factory () : TAO_Persistent_Naming_Context_Factory () { } - /// Destructor. Does not deallocate the hash map: if an instance of - /// this class goes out of scope, its hash_map remains in persistent storage. +/// Destructor. Does not deallocate the hash map: if an instance of +/// this class goes out of scope, its hash_map remains in persistent storage. TAO_FT_Persistent_Naming_Context_Factory::~TAO_FT_Persistent_Naming_Context_Factory () { } @@ -28,19 +28,11 @@ TAO_FT_Persistent_Naming_Context_Factory::create_naming_context_impl ( { // Construct the naming context, forwarding the map and counter even if they // are defaulted -#if defined (ACE_HAS_NEW_NOTHROW) return new (ACE_nothrow) TAO_FT_Persistent_Naming_Context (poa, poa_id, context_index, map, counter); -#else - return new TAO_FT_Persistent_Naming_Context (poa, - poa_id, - context_index, - map, - counter); -#endif /* ACE_HAS_NEW_NOTHROW */ } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp index 448c6100d03..79cd28d7408 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp @@ -754,21 +754,13 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, TAO_Storable_Naming_Context_Factory * TAO_Naming_Server::storable_naming_context_factory (size_t context_size) { -#if defined (ACE_HAS_NEW_NOTHROW) return new (ACE_nothrow) TAO_Storable_Naming_Context_Factory (context_size); -#else - return new TAO_Storable_Naming_Context_Factory (context_size); -#endif /* ACE_HAS_NEW_NOTHROW */ } TAO_Persistent_Naming_Context_Factory * TAO_Naming_Server::persistent_naming_context_factory () { -#if defined (ACE_HAS_NEW_NOTHROW) return new (ACE_nothrow) TAO_Persistent_Naming_Context_Factory; -#else - return new TAO_Persistent_Naming_Context_Factory; -#endif /* ACE_HAS_NEW_NOTHROW */ } int diff --git a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp index 8d98362f74f..ec5923e775d 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Persistent_Naming_Context_Factory.cpp @@ -27,20 +27,11 @@ TAO_Persistent_Naming_Context_Factory::create_naming_context_impl ( { // Construct the naming context, forwarding the map and counter even if they // are defaulted -#if defined (ACE_HAS_NEW_NOTHROW) return new (ACE_nothrow) TAO_Persistent_Naming_Context (poa, poa_id, context_index, map, counter); -#else - return new TAO_Persistent_Naming_Context (poa, - poa_id, - context_index, - map, - counter); - -#endif /* ACE_HAS_NEW_NOTHROW */ } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Var_Size_Argument_T.cpp b/TAO/tao/Var_Size_Argument_T.cpp index a2bf18ce09a..666a4831cd2 100644 --- a/TAO/tao/Var_Size_Argument_T.cpp +++ b/TAO/tao/Var_Size_Argument_T.cpp @@ -98,11 +98,7 @@ TAO::Out_Var_Size_Argument_T<S,Insert_Policy>::demarshal ( TAO_InputCDR & cdr ) { -#if defined (ACE_HAS_NEW_NOTHROW) this->x_ = new (ACE_nothrow) S; -#else - this->x_ = new S; -#endif /* ACE_HAS_NEW_NOTHROW */ return cdr >> *this->x_; } diff --git a/TAO/tests/POA/DSI/Database_i.cpp b/TAO/tests/POA/DSI/Database_i.cpp index d6d92f509fa..f4b2088a376 100644 --- a/TAO/tests/POA/DSI/Database_i.cpp +++ b/TAO/tests/POA/DSI/Database_i.cpp @@ -351,7 +351,6 @@ DatabaseImpl::Employee::operator delete (void *pointer) DATABASE::instance ()->free (pointer); } -#if defined (ACE_HAS_NEW_NOTHROW) /// Overloaded new operator, nothrow_t variant. void * DatabaseImpl::Employee::operator new (size_t size, const ACE_nothrow_t &) @@ -365,6 +364,4 @@ DatabaseImpl::Employee::operator delete (void *ptr, const ACE_nothrow_t&) throw DATABASE::instance ()->free (ptr); } -#endif /* ACE_HAS_NEW_NOTHROW */ - ACE_SINGLETON_TEMPLATE_INSTANTIATE(ACE_Singleton, DatabaseImpl::Simpler_Database_Malloc, ACE_Null_Mutex); diff --git a/TAO/tests/POA/DSI/Database_i.h b/TAO/tests/POA/DSI/Database_i.h index 4bfdc8c8714..b9655f16600 100644 --- a/TAO/tests/POA/DSI/Database_i.h +++ b/TAO/tests/POA/DSI/Database_i.h @@ -112,12 +112,9 @@ public: CORBA::Long id () const; void id (CORBA::Long id); -#if defined (ACE_HAS_NEW_NOTHROW) - /// Overloaded new operator, nothrow_t variant. - void *operator new (size_t bytes, const ACE_nothrow_t &nt); - void operator delete (void *p, const ACE_nothrow_t&) throw (); -#endif /* ACE_HAS_NEW_NOTHROW */ - + /// Overloaded new operator, nothrow_t variant. + void *operator new (size_t bytes, const ACE_nothrow_t &nt); + void operator delete (void *p, const ACE_nothrow_t&) throw (); void *operator new (size_t); void operator delete (void *pointer); |