Defines a class that provided a highly optimized memory management scheme for allocating memory statically.
More...
#include <Malloc_T.h>
List of all members.
Public Member Functions |
| ACE_Static_Allocator (void) |
| ACE_Static_Allocator_Base (char *buffer, size_t size) |
virtual void * | malloc (size_t nbytes) |
| Allocate nbytes, but don't give them any initial value.
|
virtual void * | calloc (size_t nbytes, char initial_value= '\0') |
| Allocate nbytes, giving them initial_value.
|
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()).
|
virtual int | remove (void) |
| Remove any resources associated with this memory manager.
|
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.
|
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 (void) const |
| Dump the state of the object.
|
| ACE_Allocator (void) |
| "No-op" constructor (needed to make certain compilers happy).
|
virtual | ~ACE_Allocator (void) |
| Virtual destructor.
|
Private Attributes |
char | pool_ [POOL_SIZE] |
| Pool contents.
|
Additional Inherited Members |
| ACE_Static_Allocator_Base (void) |
| Don't allow direct instantiations of this class.
|
char * | buffer_ |
| Pointer to the buffer.
|
size_t | size_ |
| Size of the buffer.
|
size_t | offset_ |
| Pointer to the current offset in the <buffer_>.
|
Detailed Description
template<size_t POOL_SIZE>
class ACE_Static_Allocator< POOL_SIZE >
Defines a class that provided a highly optimized memory management scheme for allocating memory statically.
This class allocates a fixed-size POOL_SIZE
of memory and uses the ACE_Static_Allocator_Base class implementations of malloc() and calloc() to optimize memory allocation from this pool.
Constructor & Destructor Documentation
template<size_t POOL_SIZE>
Member Data Documentation
template<size_t POOL_SIZE>
The documentation for this class was generated from the following file: