ACE  6.1.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes
ACE_Static_Allocator< POOL_SIZE > Class Template Reference

Defines a class that provided a highly optimized memory management scheme for allocating memory statically. More...

#include <Malloc_T.h>

Inheritance diagram for ACE_Static_Allocator< POOL_SIZE >:
Inheritance graph
[legend]
Collaboration diagram for ACE_Static_Allocator< POOL_SIZE >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ACE_Static_Allocator (void)
- Public Member Functions inherited from ACE_Static_Allocator_Base
 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.
- Public Member Functions inherited from ACE_Allocator
 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

- Protected Member Functions inherited from ACE_Static_Allocator_Base
 ACE_Static_Allocator_Base (void)
 Don't allow direct instantiations of this class.
- Protected Attributes inherited from ACE_Static_Allocator_Base
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>
ACE_Static_Allocator< POOL_SIZE >::ACE_Static_Allocator ( void  )
inline

Member Data Documentation

template<size_t POOL_SIZE>
char ACE_Static_Allocator< POOL_SIZE >::pool_[POOL_SIZE]
private

Pool contents.


The documentation for this class was generated from the following file: