8 #ifndef OPENDDS_DCPS_DYNAMIC_CACHED_ALLOCATOR_WITH_OVERFLOW_T_H 9 #define OPENDDS_DCPS_DYNAMIC_CACHED_ALLOCATOR_WITH_OVERFLOW_T_H 20 #if !defined (ACE_LACKS_PRAGMA_ONCE) 44 template <
class ACE_LOCK>
101 "(%P|%t) Dynamic_Cached_Allocator_With_Overflow::malloc %x" 102 " %d heap allocs with %d outstanding\n",
109 "(%P|%t) Dynamic_Cached_Allocator_With_Overflow::malloc %@" 110 " %Lu heap allocs with %Lu outstanding\n",
121 "(%P|%t) Dynamic_Cached_Allocator_With_Overflow::malloc %x" 122 " %d pool allocs %d pool free with %d available\n",
152 unsigned char* tmp =
static_cast<unsigned char*
> (ptr);
160 "(%P|%t) ERROR: Dynamic_Cached_Allocator_With_Overflow::free %x" 161 " more deletes %d than allocs %d to the heap\n",
170 "(%P|%t) Dynamic_Cached_Allocator_With_Overflow::free %@" 171 " %Lu heap allocs with %Lu outstanding\n",
179 }
else if (ptr != 0) {
184 "(%P|%t) ERROR: Dynamic_Cached_Allocator_With_Overflow::free %x" 185 " more deletes %d than allocs %d from the pool\n",
196 "(%P|%t) Dynamic_Cached_Allocator_With_Overflow::malloc %x" 197 " %d pool allocs %d pool frees with %d available\n",
virtual ACE_Cached_Mem_Pool_Node< char > * remove(void)
Dynamic_Cached_Allocator_With_Overflow(size_t n_chunks, size_t chunk_size)
#define ACE_MALLOC_ROUNDUP(X, Y)
~Dynamic_Cached_Allocator_With_Overflow()
Clear things up.
virtual void free(void *ptr)=0
virtual void * calloc(size_t, char='\0')
size_t pool_depth()
Return the number of chunks available in the cache.
Atomic< unsigned long > allocs_from_heap_
number of allocations from the heap.
ACE_Locked_Free_List< ACE_Cached_Mem_Pool_Node< char >, ACE_LOCK > free_list_
void * malloc(size_t nbytes=0)
unsigned char * end_
The end of the pool.
size_t chunk_size_
Remember the size of our chunks.
Atomic< unsigned long > frees_to_heap_
number of frees returned to the heap
static ACE_Allocator * instance(void)
virtual size_t size(void)
virtual void add(ACE_Cached_Mem_Pool_Node< char > *element)
A size-based allocator that caches blocks for quicker access, but if the pool is exhausted it will us...
void free(void *ptr)
Return a chunk of memory back to free list cache.
virtual void * calloc(size_t, size_t, char='\0')
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Atomic< unsigned long > allocs_from_pool_
number of allocations from the pool.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
Atomic< unsigned long > frees_to_pool_
number of frees returned to the pool
The Internal API and Implementation of OpenDDS.
#define ACE_NOTSUP_RETURN(FAILVALUE)
#define ACE_PURE_FREE_LIST
virtual void * malloc(size_type nbytes)=0