Defines a class that provided a highly optimized memory management scheme for allocating memory statically.
More...
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.
|
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.