diff options
author | bala <balanatarajan@users.noreply.github.com> | 2002-08-01 16:17:18 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2002-08-01 16:17:18 +0000 |
commit | bb51c38a649d2d52e5138566f4a524e0b8c42694 (patch) | |
tree | e698961d8b4616f16c7496bb1b0b5c6b0461ce5e | |
parent | 48f51c403f8ee9a483f4187dadedf70ddb6ba702 (diff) | |
download | ATCD-bb51c38a649d2d52e5138566f4a524e0b8c42694.tar.gz |
ChangeLogTag: Thu Aug 1 11:13:20 2002 Balachandran Natarajan <bala@cs.wustl.edu>
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | ChangeLogs/ChangeLog-03a | 15 | ||||
-rw-r--r-- | ace/Malloc.cpp | 35 | ||||
-rw-r--r-- | ace/Malloc.h | 1 | ||||
-rw-r--r-- | ace/Malloc_Allocator.cpp | 33 | ||||
-rw-r--r-- | ace/Malloc_Allocator.h | 20 |
6 files changed, 66 insertions, 53 deletions
diff --git a/ChangeLog b/ChangeLog index 0b4a9292fcc..e6e3d493d3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +Thu Aug 1 11:13:20 2002 Balachandran Natarajan <bala@cs.wustl.edu> + + * ace/Malloc_Allocator.h: + * ace/Malloc_Allocator.cpp: Removed the declaration and definition + of ACE_Malloc_Stats since they are not needed in this + translation unit. + + * ace/Malloc.h: + * ace/Malloc.cpp: Retained the definition if ACE_Malloc_Stats here + (yes, there were two declarations) and added the definition and + template instantiation for ACE_Atomic_Op used by + ACE_Alloc_Stats. This should fix the erros showing up on the + scoreboard explicit template builds which has + ACE_HAS_MALLOC_STATS turned on. + Thu Aug 1 09:08:36 2002 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> * ace/Message_Block.h: Made the non-static duplicate() and release() diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a index 0b4a9292fcc..e6e3d493d3b 100644 --- a/ChangeLogs/ChangeLog-03a +++ b/ChangeLogs/ChangeLog-03a @@ -1,3 +1,18 @@ +Thu Aug 1 11:13:20 2002 Balachandran Natarajan <bala@cs.wustl.edu> + + * ace/Malloc_Allocator.h: + * ace/Malloc_Allocator.cpp: Removed the declaration and definition + of ACE_Malloc_Stats since they are not needed in this + translation unit. + + * ace/Malloc.h: + * ace/Malloc.cpp: Retained the definition if ACE_Malloc_Stats here + (yes, there were two declarations) and added the definition and + template instantiation for ACE_Atomic_Op used by + ACE_Alloc_Stats. This should fix the erros showing up on the + scoreboard explicit template builds which has + ACE_HAS_MALLOC_STATS turned on. + Thu Aug 1 09:08:36 2002 Douglas C. Schmidt <schmidt@macarena.cs.wustl.edu> * ace/Message_Block.h: Made the non-static duplicate() and release() diff --git a/ace/Malloc.cpp b/ace/Malloc.cpp index b0bd07f6d5d..01c6353b5e7 100644 --- a/ace/Malloc.cpp +++ b/ace/Malloc.cpp @@ -158,4 +158,39 @@ ACE_Control_Block::ACE_Name_Node::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } + +#if defined (ACE_HAS_MALLOC_STATS) +ACE_Malloc_Stats::ACE_Malloc_Stats (void) + : nblocks_ (0), + nchunks_ (0), + ninuse_ (0) +{ + ACE_TRACE ("ACE_Malloc_Stats::ACE_Malloc_Stats"); +} + +void +ACE_Malloc_Stats::dump (void) const +{ + ACE_TRACE ("ACE_Malloc_Stats::dump"); + + ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); + int nblocks = this->nblocks_.value (); + int ninuse = this->ninuse_.value (); + int nchunks = this->nchunks_.value (); + + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("nblocks = %d"), nblocks)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("\nninuse = %d"), ninuse)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("\nnchunks = %d"), nchunks)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("\n"))); + ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Atomic_Op<ACE_PROCESS_MUTEX, int>; +template class ACE_Atomic_Op_Ex<ACE_PROCESS_MUTEX, int>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate ACE_Atomic_Op<ACE_PROCESS_MUTEX, int> +#pragma instantiate ACE_Atomic_Op_Ex<ACE_PROCESS_MUTEX, int> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ +#endif /*ACE_HAS_MALLOC_STATS*/ #endif /* ACE_MALLOC_CPP */ diff --git a/ace/Malloc.h b/ace/Malloc.h index e5272f66774..f682a20f0c1 100644 --- a/ace/Malloc.h +++ b/ace/Malloc.h @@ -25,6 +25,7 @@ #include "ace/Log_Msg.h" #if defined (ACE_HAS_MALLOC_STATS) +#include "ace/Atomic_Op.h" #if defined (ACE_HAS_THREADS) #include "ace/Process_Mutex.h" #define ACE_PROCESS_MUTEX ACE_Process_Mutex diff --git a/ace/Malloc_Allocator.cpp b/ace/Malloc_Allocator.cpp index 5f98c01746a..9c119f904c2 100644 --- a/ace/Malloc_Allocator.cpp +++ b/ace/Malloc_Allocator.cpp @@ -127,39 +127,6 @@ ACE_Static_Allocator_Base::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } -#if defined (ACE_HAS_MALLOC_STATS) -ACE_Malloc_Stats::ACE_Malloc_Stats (void) - : nblocks_ (0), - nchunks_ (0), - ninuse_ (0) -{ - ACE_TRACE ("ACE_Malloc_Stats::ACE_Malloc_Stats"); -} - -void -ACE_Malloc_Stats::dump (void) const -{ - ACE_TRACE ("ACE_Malloc_Stats::dump"); - - ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); - int nblocks = this->nblocks_.value (); - int ninuse = this->ninuse_.value (); - int nchunks = this->nchunks_.value (); - - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("nblocks = %d"), nblocks)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("\nninuse = %d"), ninuse)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("\nnchunks = %d"), nchunks)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT("\n"))); - ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); -} -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Atomic_Op<ACE_PROCESS_MUTEX, int>; -template class ACE_Atomic_Op_Ex<ACE_PROCESS_MUTEX, int>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Atomic_Op<ACE_PROCESS_MUTEX, int> -#pragma instantiate ACE_Atomic_Op_Ex<ACE_PROCESS_MUTEX, int> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ -#endif /* ACE_HAS_MALLOC_STATS */ #endif /* ACE_MALLOC_ALLOCATOR_CPP */ diff --git a/ace/Malloc_Allocator.h b/ace/Malloc_Allocator.h index 6c2e20f8a89..2c3c71428ff 100644 --- a/ace/Malloc_Allocator.h +++ b/ace/Malloc_Allocator.h @@ -34,26 +34,6 @@ #define ACE_PROCESS_MUTEX ACE_SV_Semaphore_Simple #endif /* ACE_HAS_THREADS */ -typedef ACE_Atomic_Op<ACE_PROCESS_MUTEX, int> ACE_INT; - -/// This keeps stats on the usage of the memory manager. -struct ACE_Export ACE_Malloc_Stats -{ - ACE_Malloc_Stats (void); - void dump (void) const; - - /// Coarse-grained unit of allocation. - ACE_INT nchunks_; - - /// Fine-grained unit of allocation. - ACE_INT nblocks_; - - /// Number of blocks in use - ACE_INT ninuse_; -}; -#define ACE_MALLOC_STATS(X) X -#else -#define ACE_MALLOC_STATS(X) #endif /* ACE_HAS_MALLOC_STATS */ /** |