diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-04-23 04:43:59 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-04-23 04:43:59 +0000 |
commit | a7c03cabf931b077d70c6f80ec02c7728a429f49 (patch) | |
tree | 61d38d262d43ac77fc2ad94c9e7e850cd5607622 /ace/Malloc_T.cpp | |
parent | 2aa7b10780ad7c670f588dce4ec341351a0646aa (diff) | |
download | ATCD-a7c03cabf931b077d70c6f80ec02c7728a429f49.tar.gz |
ChangeLogTag:Sat Apr 22 20:53:11 2000 Darrell Brunsch <brunsch@uci.edu>
Diffstat (limited to 'ace/Malloc_T.cpp')
-rw-r--r-- | ace/Malloc_T.cpp | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/ace/Malloc_T.cpp b/ace/Malloc_T.cpp index 16f878907d9..2007903d052 100644 --- a/ace/Malloc_T.cpp +++ b/ace/Malloc_T.cpp @@ -44,7 +44,7 @@ ACE_Cached_Allocator<T, ACE_LOCK>::~ACE_Cached_Allocator (void) ACE_ALLOC_HOOK_DEFINE (ACE_Malloc_T) template <class MALLOC> -ACE_Allocator_Adapter<MALLOC>::ACE_Allocator_Adapter (LPCTSTR pool_name) +ACE_Allocator_Adapter<MALLOC>::ACE_Allocator_Adapter (const ACE_TCHAR *pool_name) : allocator_ (pool_name) { ACE_TRACE ("ACE_Allocator_Adapter<MALLOC>::ACE_Allocator_Adapter"); @@ -79,8 +79,8 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); this->memory_pool_.dump (); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("cb_ptr_ = %x"), this->cb_ptr_)); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("cb_ptr_ = %x"), this->cb_ptr_)); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); this->cb_ptr_->dump (); #if defined (ACE_HAS_MALLOC_STATS) if (this->cb_ptr_ != 0) @@ -101,14 +101,14 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::print_stats (void) const return; this->cb_ptr_->malloc_stats_.dump (); ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("(%P|%t) contents of freelist:\n"))); + ACE_TEXT ("(%P|%t) contents of freelist:\n"))); for (MALLOC_HEADER *currp = this->cb_ptr_->freep_->next_block_; ; currp = currp->next_block_) { ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("(%P|%t) ptr = %u, MALLOC_HEADER units = %d, byte units = %d\n"), + ACE_TEXT ("(%P|%t) ptr = %u, MALLOC_HEADER units = %d, byte units = %d\n"), currp, currp->size_, currp->size_ * sizeof (MALLOC_HEADER))); @@ -151,12 +151,12 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::open (void) first_time); if (this->cb_ptr_ == 0) ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("(%P|%t) %p\n"), - ASYS_TEXT ("init_acquire failed")), + ACE_TEXT ("(%P|%t) %p\n"), + ACE_TEXT ("init_acquire failed")), -1); else if (first_time) { - // ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%P|%t) first time in, control block = %u\n"), this->cb_ptr_)); + // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) first time in, control block = %u\n"), this->cb_ptr_)); MALLOC_HEADER::init_ptr (&this->cb_ptr_->freep_, &this->cb_ptr_->base_, @@ -209,7 +209,7 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::open (void) } template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> -ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T (LPCTSTR pool_name) +ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T (const ACE_TCHAR *pool_name) : memory_pool_ (pool_name), lock_ (pool_name == 0 ? 0 : ACE::basename (pool_name, ACE_DIRECTORY_SEPARATOR_CHAR)) @@ -217,13 +217,13 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T (LPCTSTR pool_name) ACE_TRACE ("ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T"); if (this->open () == -1) ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("%p\n"), - ASYS_TEXT ("ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T"))); + ACE_TEXT ("%p\n"), + ACE_TEXT ("ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T"))); } template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> -ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T (LPCTSTR pool_name, - LPCTSTR lock_name, +ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T (const ACE_TCHAR *pool_name, + const ACE_TCHAR *lock_name, const ACE_MEM_POOL_OPTIONS *options) : memory_pool_ (pool_name, options), lock_ (lock_name != 0 ? lock_name : ACE::basename (pool_name, @@ -232,14 +232,14 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T (LPCTSTR pool_name, ACE_TRACE ("ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T"); if (this->open () == -1) ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("%p"), - ASYS_TEXT ("ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T"))); + ACE_TEXT ("%p"), + ACE_TEXT ("ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T"))); } #if !defined (ACE_HAS_TEMPLATE_TYPEDEFS) template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> -ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T (LPCTSTR pool_name, - LPCTSTR lock_name, +ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T (const ACE_TCHAR *pool_name, + const ACE_TCHAR *lock_name, const void *options) : memory_pool_ (pool_name, (const ACE_MEM_POOL_OPTIONS *) options), @@ -248,8 +248,8 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T (LPCTSTR pool_name, ACE_TRACE ("ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T"); if (this->open () == -1) ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("%p"), - ASYS_TEXT ("ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T"))); + ACE_TEXT ("%p"), + ACE_TEXT ("ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ACE_Malloc_T"))); } #endif /* ACE_HAS_TEMPLATE_TYPEDEFS */ @@ -266,7 +266,7 @@ template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> int ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::remove (void) { ACE_TRACE ("ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::remove"); - // ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%P|%t) destroying ACE_Malloc_T\n"))); + // ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) destroying ACE_Malloc_T\n"))); int result = 0; #if defined (ACE_HAS_MALLOC_STATS) @@ -378,10 +378,15 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::shared_malloc (size_t nbytes) currp = this->cb_ptr_->freep_; } else - ACE_ERROR_RETURN ((LM_ERROR, - ASYS_TEXT ("(%P|%t) %p\n"), - ASYS_TEXT ("malloc")), - 0); + return 0; + // Shouldn't do this here because of errors with the wchar ver + // This is because ACE_ERROR_RETURN converts the __FILE__ to + // wchar before printing out. The compiler will complain + // about this since a destructor would present in a SEH block + //ACE_ERROR_RETURN ((LM_ERROR, + // ACE_TEXT ("(%P|%t) %p\n"), + // ACE_TEXT ("malloc")), + // 0); } prevp = currp; currp = currp->next_block_; @@ -691,8 +696,8 @@ ACE_Malloc_LIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); this->curr_->dump (); this->guard_.dump (); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("name_ = %s"), this->name_)); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("name_ = %s"), this->name_)); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } @@ -784,8 +789,8 @@ ACE_Malloc_FIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); this->curr_->dump (); this->guard_.dump (); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("name_ = %s"), this->name_)); - ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("name_ = %s"), this->name_)); + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\n"))); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } |