diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-04-25 08:38:19 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-04-25 08:38:19 +0000 |
commit | 5f0af25f510aff38b563be82feffaa6fe754a434 (patch) | |
tree | be4a14377d887532a5bd2605679935dba88974c0 /ace/Malloc_T.i | |
parent | 96db723746a3bdeed63bee252cb9258b52a42773 (diff) | |
download | ATCD-5f0af25f510aff38b563be82feffaa6fe754a434.tar.gz |
ChangeLogTag:Wed Apr 25 03:15:34 2001 Nanbor Wang <nanbor@cs.wustl.edu>
Diffstat (limited to 'ace/Malloc_T.i')
-rw-r--r-- | ace/Malloc_T.i | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ace/Malloc_T.i b/ace/Malloc_T.i index dbe502de44b..31c5b403cdd 100644 --- a/ace/Malloc_T.i +++ b/ace/Malloc_T.i @@ -170,6 +170,26 @@ ACE_Allocator_Adapter<MALLOC>::sync (void *addr, size_t len, int flags) return this->allocator_.sync (addr, len, flags); } +template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int +ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ref_counter (void) +{ + ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->lock_, -1); + if (this->cb_ptr_ != 0) + return this->cb_ptr_->ref_counter_; + + return -1; +} + +template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int +ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::release (void) +{ + ACE_GUARD_RETURN (ACE_LOCK, ace_mon, (ACE_LOCK &) this->lock_, -1); + if (this->cb_ptr_ != 0) + return --this->cb_ptr_->ref_counter_; + else + return -1; +} + template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE ACE_MEM_POOL & ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::memory_pool (void) { |