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 ()
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 ()
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 ()
32 return this->free_list_.size ();
35 template <class ACE_LOCK> ACE_INLINE size_t
36 ACE_Dynamic_Cached_Allocator<ACE_LOCK>::pool_depth ()
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 ()
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 ()
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_ != nullptr)
63 int const retv = --this->cb_ptr_->ref_counter_;
67 this->memory_pool_.release (0);
81 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE ACE_MEM_POOL &
82 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::memory_pool ()
84 ACE_TRACE ("ACE_Malloc_T<MEMORY_POOL, ACE_LOCK, ACE_CB>::memory_pool");
85 return this->memory_pool_;
88 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int
89 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::sync (ssize_t len,
92 ACE_TRACE ("ACE_Malloc_T<MEMORY_POOL, ACE_LOCK, ACE_CB>::sync");
93 return this->memory_pool_.sync (len, flags);
96 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int
97 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::sync (void *addr,
101 ACE_TRACE ("ACE_Malloc_T<MEMORY_POOL, ACE_LOCK, ACE_CB>::sync");
102 return this->memory_pool_.sync (addr, len, flags);
105 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int
106 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::protect (ssize_t len,
109 ACE_TRACE ("ACE_Malloc_T<MEMORY_POOL, ACE_LOCK, ACE_CB>::protect");
110 return this->memory_pool_.protect (len, flags);
113 template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> ACE_INLINE int
114 ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::protect (void *addr, size_t len, int flags)
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 ()
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 ()
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