2 #include "ace/OS_NS_string.h"
4 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
6 template <class T> ACE_INLINE T *
7 ACE_Cached_Mem_Pool_Node<T>::addr (void)
9 // This should be done using a single reinterpret_cast, but Sun/CC
10 // (4.2) gets awfully confused when T is a char[20] (and maybe other
12 return static_cast<T *> (static_cast <void *> (this));
15 template <class T> ACE_INLINE ACE_Cached_Mem_Pool_Node<T> *
16 ACE_Cached_Mem_Pool_Node<T>::get_next (void)
21 template <class T> ACE_INLINE void
22 ACE_Cached_Mem_Pool_Node<T>::set_next (ACE_Cached_Mem_Pool_Node<T> *ptr)
27 ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Cached_Mem_Pool_Node)
29 template <class T, class ACE_LOCK> ACE_INLINE size_t
30 ACE_Cached_Allocator<T, ACE_LOCK>::pool_depth (void)
32 return this->free_list_.size ();
35 template <class ACE_LOCK> ACE_INLINE size_t
36 ACE_Dynamic_Cached_Allocator<ACE_LOCK>::pool_depth (void)
38 return this->free_list_.size ();
41 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int
42 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::ref_counter (void)
44 ACE_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1);
45 if (this->cb_ptr_ != 0)
46 return this->cb_ptr_->ref_counter_;
51 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int
52 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::bad (void)
54 return this->bad_flag_;
57 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int
58 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::release (int close)
60 ACE_GUARD_RETURN (ACE_LOCK, ace_mon, *this->lock_, -1);
61 if (this->cb_ptr_ != 0)
63 int const retv = --this->cb_ptr_->ref_counter_;
66 this->memory_pool_.release (0);
79 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE ACE_MEM_POOL &
80 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::memory_pool (void)
82 ACE_TRACE ("ACE_Malloc_T<MEMORY_POOL, ACE_LOCK, ACE_CB>::memory_pool");
83 return this->memory_pool_;
86 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int
87 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::sync (ssize_t len,
90 ACE_TRACE ("ACE_Malloc_T<MEMORY_POOL, ACE_LOCK, ACE_CB>::sync");
91 return this->memory_pool_.sync (len, flags);
94 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int
95 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::sync (void *addr,
99 ACE_TRACE ("ACE_Malloc_T<MEMORY_POOL, ACE_LOCK, ACE_CB>::sync");
100 return this->memory_pool_.sync (addr, len, flags);
103 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int
104 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::protect (ssize_t len,
107 ACE_TRACE ("ACE_Malloc_T<MEMORY_POOL, ACE_LOCK, ACE_CB>::protect");
108 return this->memory_pool_.protect (len, flags);
111 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int
112 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::protect (void *addr,
116 ACE_TRACE ("ACE_Malloc_T<MEMORY_POOL, ACE_LOCK, ACE_CB>::protect");
117 return this->memory_pool_.protect (addr, len, flags);
120 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE ACE_LOCK &
121 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::mutex (void)
126 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE void *
127 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::base_addr (void)
129 return this->cb_ptr_;
132 template <ACE_MEM_POOL_1, class ACE_LOCK> ACE_INLINE
133 ACE_Malloc<ACE_MEM_POOL_2, ACE_LOCK>::ACE_Malloc (const ACE_TCHAR *pool_name)
134 : ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_Control_Block> (pool_name)
138 template <ACE_MEM_POOL_1, class ACE_LOCK> ACE_INLINE
139 ACE_Malloc<ACE_MEM_POOL_2, ACE_LOCK>::ACE_Malloc (const ACE_TCHAR *pool_name,
140 const ACE_TCHAR *lock_name,
141 const ACE_MEM_POOL_OPTIONS *options)
142 : ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_Control_Block> (pool_name, lock_name, options)
146 template <ACE_MEM_POOL_1, class ACE_LOCK> ACE_INLINE
147 ACE_Malloc_LIFO_Iterator<ACE_MEM_POOL_2, ACE_LOCK>::ACE_Malloc_LIFO_Iterator (ACE_Malloc<ACE_MEM_POOL_2, ACE_LOCK> &malloc,
149 : ACE_Malloc_LIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_Control_Block> (malloc, name)
153 template <ACE_MEM_POOL_1, class ACE_LOCK> ACE_INLINE
154 ACE_Malloc_FIFO_Iterator<ACE_MEM_POOL_2, ACE_LOCK>::ACE_Malloc_FIFO_Iterator (ACE_Malloc<ACE_MEM_POOL_2, ACE_LOCK> &malloc,
156 : ACE_Malloc_FIFO_Iterator_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_Control_Block> (malloc, name)
160 ACE_END_VERSIONED_NAMESPACE_DECL