From ffd05af4cf7f373998b44b72cfad106a37491363 Mon Sep 17 00:00:00 2001 From: nanbor Date: Sat, 28 Dec 2002 03:16:36 +0000 Subject: Reverted accidental checkins --- ace/MEM_SAP.cpp | 8 -------- ace/Malloc_T.cpp | 23 +++++++++-------------- ace/Malloc_T.h | 25 ++++++------------------- ace/Malloc_T.i | 6 ------ 4 files changed, 15 insertions(+), 47 deletions(-) diff --git a/ace/MEM_SAP.cpp b/ace/MEM_SAP.cpp index 1ee429f57c9..e9b6fe6fd6c 100644 --- a/ace/MEM_SAP.cpp +++ b/ace/MEM_SAP.cpp @@ -55,14 +55,6 @@ ACE_MEM_SAP::create_shm_malloc (const ACE_TCHAR *name, options), -1); - if (this->shm_malloc_->bad () != 0) - { - this->shm_malloc_->remove (); // Cleanup OS resources - delete this->shm_malloc_; - this->shm_malloc_ = 0; - return -1; - } - return 0; } diff --git a/ace/Malloc_T.cpp b/ace/Malloc_T.cpp index faf7b0f942a..5554f81a713 100644 --- a/ace/Malloc_T.cpp +++ b/ace/Malloc_T.cpp @@ -280,8 +280,7 @@ ACE_Malloc_T::open (void) template ACE_Malloc_T::ACE_Malloc_T (const ACE_TCHAR *pool_name) - : memory_pool_ (pool_name), - bad_flag_ (0) + : memory_pool_ (pool_name) { ACE_TRACE ("ACE_Malloc_T::ACE_Malloc_T"); if (pool_name == 0) @@ -291,7 +290,7 @@ ACE_Malloc_T::ACE_Malloc_T (const ACE_TCHAR *p ACE_DIRECTORY_SEPARATOR_CHAR))); this->delete_lock_ = 1; - if ((this->bad_flag_ = this->open ()) == -1) + if (this->open () == -1) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), ACE_LIB_TEXT ("ACE_Malloc_T::ACE_Malloc_T"))); @@ -301,8 +300,7 @@ template ACE_Malloc_T::ACE_Malloc_T (const ACE_TCHAR *pool_name, const ACE_TCHAR *lock_name, const ACE_MEM_POOL_OPTIONS *options) - : memory_pool_ (pool_name, options), - bad_flag_ (0) + : memory_pool_ (pool_name, options) { ACE_TRACE ("ACE_Malloc_T::ACE_Malloc_T"); if (lock_name != 0) @@ -312,7 +310,7 @@ ACE_Malloc_T::ACE_Malloc_T (const ACE_TCHAR *p ACE_DIRECTORY_SEPARATOR_CHAR))); this->delete_lock_ = 1; - if ((this->bad_flag_ = this->open ()) == -1) + if (this->open () == -1) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), ACE_LIB_TEXT ("ACE_Malloc_T::ACE_Malloc_T"))); @@ -324,20 +322,18 @@ ACE_Malloc_T::ACE_Malloc_T (const ACE_TCHAR *p const ACE_MEM_POOL_OPTIONS *options, ACE_LOCK *lock) : memory_pool_ (pool_name, options), - lock_ (lock), - delete_lock_ (0), - bad_flag_ (0) + lock_ (lock) { ACE_TRACE ("ACE_Malloc_T::ACE_Malloc_T"); if (lock == 0) { - this->bad_flag_ = -1; errno = EINVAL; return; } + this->delete_lock_ = 0; - if ((this->bad_flag_ = this->open ()) == -1) + if (this->open () == -1) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), ACE_LIB_TEXT ("ACE_Malloc_T::ACE_Malloc_T"))); @@ -349,14 +345,13 @@ ACE_Malloc_T::ACE_Malloc_T (const ACE_TCHAR *p const ACE_TCHAR *lock_name, const void *options) : memory_pool_ (pool_name, - (const ACE_MEM_POOL_OPTIONS *) options), - bad_flag_ (0) + (const ACE_MEM_POOL_OPTIONS *) options) { ACE_TRACE ("ACE_Malloc_T::ACE_Malloc_T"); ACE_NEW (this->lock_, ACE_LOCK (lock_name)); this->delete_lock_ = 1; - if ((this->bad_flag_ = this->open ()) == -1) + if (this->open () == -1) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), ACE_LIB_TEXT ("ACE_Malloc_T::ACE_Malloc_T"))); diff --git a/ace/Malloc_T.h b/ace/Malloc_T.h index 32b4b2a31dd..95ac6c157e2 100644 --- a/ace/Malloc_T.h +++ b/ace/Malloc_T.h @@ -6,7 +6,7 @@ * * $Id$ * - * @author Douglas C. Schmidt and + * @author Douglas C. Schmidt and * Irfan Pyarali */ //========================================================================== @@ -215,7 +215,7 @@ public: /** * Note that @a pool_name should be located in * a directory with the appropriate visibility and protection so - * that all processes that need to access it can do so. + * that all processes that need to access it can do so. * This constructor must be inline to avoid bugs with some C++ * compilers. */ ACE_Allocator_Adapter (const char *pool_name, @@ -238,7 +238,7 @@ public: /** * Note that @a pool_name should be located in * a directory with the appropriate visibility and protection so - * that all processes that need to access it can do so. + * that all processes that need to access it can do so. * This constructor must be inline to avoid bugs with some C++ * compilers. */ ACE_Allocator_Adapter (const wchar_t *pool_name, @@ -423,7 +423,7 @@ public: * * Note that @a pool_name should be located in * a directory with the appropriate visibility and protection so - * that all processes that need to access it can do so. + * that all processes that need to access it can do so. */ ACE_Malloc_T (const ACE_TCHAR *pool_name = 0); @@ -436,7 +436,7 @@ public: * * Note that @a pool_name should be located in * a directory with the appropriate visibility and protection so - * that all processes that need to access it can do so. + * that all processes that need to access it can do so. */ ACE_Malloc_T (const ACE_TCHAR *pool_name, const ACE_TCHAR *lock_name, @@ -594,16 +594,6 @@ public: /// Return cb_ptr value. void *base_addr (void); - /** - * Bad flag. This operation should be called immediately after the - * construction of the Malloc object to query whether the object was - * constructed successfully. If not, the user should invoke @c - * remove and release the object (it is not usable.) - * @retval 0 if all is fine. non-zero if this malloc object is - * unuable. - */ - int bad (void); - private: /// Initialize the Malloc pool. int open (void); @@ -637,9 +627,6 @@ private: /// Lock that ensures mutual exclusion for the memory pool. ACE_LOCK *lock_; int delete_lock_; // True if destructor should delete the lock - - /// Keep track of failure in constructor. - int bad_flag_; }; /** @@ -797,7 +784,7 @@ public: * initialize the underlying memory pool. Note that @a pool_name * should be located in a directory with the appropriate visibility * and protection so that all processes that need to access it can - * do so. + * do so. */ ACE_Malloc (const ACE_TCHAR *pool_name, const ACE_TCHAR *lock_name, diff --git a/ace/Malloc_T.i b/ace/Malloc_T.i index 6093977e5bc..53f3d5cd78e 100644 --- a/ace/Malloc_T.i +++ b/ace/Malloc_T.i @@ -220,12 +220,6 @@ ACE_Malloc_T::ref_counter (void) return -1; } -template ACE_INLINE int -ACE_Malloc_T::bad (void) -{ - return this->bad_flag_; -} - template ACE_INLINE int ACE_Malloc_T::release (int close) { -- cgit v1.2.1