|
| | ACE_Cached_Allocator (size_t n_chunks) |
| |
| | ~ACE_Cached_Allocator () |
| | Clear things up. More...
|
| |
| void * | malloc (size_t nbytes=sizeof(T)) |
| |
| virtual void * | calloc (size_t nbytes, char initial_value='\0') |
| |
| virtual void * | calloc (size_t n_elem, size_t elem_size, char initial_value='\0') |
| |
| void | free (void *) |
| | Return a chunk of memory back to free list cache. More...
|
| |
| size_t | pool_depth () |
| | Return the number of chunks available in the cache. More...
|
| |
| virtual void * | malloc (size_t nbytes) |
| | These methods are defined. More...
|
| |
| virtual void * | calloc (size_t nbytes, char initial_value='\0') |
| | Allocate nbytes, giving them initial_value. More...
|
| |
| virtual void * | calloc (size_t n_elem, size_t elem_size, char initial_value='\0') |
| |
| virtual void | free (void *ptr) |
| | Free ptr (must have been allocated by ACE_Allocator::malloc()). More...
|
| |
| virtual int | remove () |
| | These methods are no-ops. More...
|
| |
| virtual int | bind (const char *name, void *pointer, int duplicates=0) |
| |
| virtual int | trybind (const char *name, void *&pointer) |
| |
| virtual int | find (const char *name, void *&pointer) |
| |
| virtual int | find (const char *name) |
| | Returns 0 if the name is in the mapping. -1, otherwise. More...
|
| |
| virtual int | unbind (const char *name) |
| |
| virtual int | unbind (const char *name, void *&pointer) |
| |
| virtual int | sync (ssize_t len=-1, int flags=MS_SYNC) |
| |
| virtual int | sync (void *addr, size_t len, int flags=MS_SYNC) |
| |
| virtual int | protect (ssize_t len=-1, int prot=PROT_RDWR) |
| |
| virtual int | protect (void *addr, size_t len, int prot=PROT_RDWR) |
| |
| virtual void | dump () const |
| | Dump the state of the object. More...
|
| |
| | ACE_Allocator () |
| | "No-op" constructor (needed to make certain compilers happy). More...
|
| |
| virtual | ~ACE_Allocator () |
| | Virtual destructor. More...
|
| |
| virtual void * | malloc (size_type nbytes)=0 |
| | Allocate nbytes, but don't give them any initial value. More...
|
| |
| virtual void * | calloc (size_type nbytes, char initial_value='\0')=0 |
| | Allocate nbytes, giving them initial_value. More...
|
| |
| virtual void * | calloc (size_type n_elem, size_type elem_size, char initial_value='\0')=0 |
| |
| virtual void | free (void *ptr)=0 |
| | Free ptr (must have been allocated by ACE_Allocator::malloc()). More...
|
| |
| virtual int | remove ()=0 |
| | Remove any resources associated with this memory manager. More...
|
| |
| virtual int | bind (const char *name, void *pointer, int duplicates=0)=0 |
| |
| virtual int | trybind (const char *name, void *&pointer)=0 |
| |
| virtual int | find (const char *name, void *&pointer)=0 |
| |
| virtual int | find (const char *name)=0 |
| | Returns 0 if the name is in the mapping. -1, otherwise. More...
|
| |
| virtual int | unbind (const char *name)=0 |
| |
| virtual int | unbind (const char *name, void *&pointer)=0 |
| |
| virtual int | sync (ssize_t len=-1, int flags=MS_SYNC)=0 |
| |
| virtual int | sync (void *addr, size_type len, int flags=MS_SYNC)=0 |
| |
| virtual int | protect (ssize_t len=-1, int prot=PROT_RDWR)=0 |
| |
| virtual int | protect (void *addr, size_type len, int prot=PROT_RDWR)=0 |
| |
| virtual void | dump () const =0 |
| | Dump the state of the object. More...
|
| |
template<class T, class ACE_LOCK>
class ACE_Cached_Allocator< T, ACE_LOCK >
A fixed-size allocator that caches items for quicker access.
This class enables caching of dynamically allocated, fixed-sized classes. Notice that the sizeof (TYPE) must be greater than or equal to sizeof (void*) for this to work properly.
This class can be configured flexibly with different types of ACE_LOCK strategies that support the ACE_Thread_Mutex, ACE_Thread_Semaphore, ACE_Process_Mutex, and ACE_Process_Semaphore constructor API.
- See also
- ACE_Dynamic_Cached_Allocator