ACE  6.3.3
Public Member Functions | Private Attributes | List of all members
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]

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. 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 (void)
 Remove any resources associated with this memory manager. 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 (void) const
 Dump the state of the object. More...
 
- Public Member Functions inherited from ACE_Allocator
 ACE_Allocator (void)
 "No-op" constructor (needed to make certain compilers happy). More...
 
virtual ~ACE_Allocator (void)
 Virtual destructor. More...
 

Private Attributes

char pool_ [POOL_SIZE]
 Pool contents. More...
 

Additional Inherited Members

- Public Types inherited from ACE_Allocator
typedef size_t size_type
 Unsigned integer type used for specifying memory block lengths. More...
 
- Static Public Member Functions inherited from ACE_Allocator
static ACE_Allocatorinstance (void)
 Get pointer to a default ACE_Allocator. More...
 
static ACE_Allocatorinstance (ACE_Allocator *)
 
static void close_singleton (void)
 Delete the dynamically allocated Singleton. More...
 
- Protected Member Functions inherited from ACE_Static_Allocator_Base
 ACE_Static_Allocator_Base (void)
 Don't allow direct instantiations of this class. More...
 
- Protected Attributes inherited from ACE_Static_Allocator_Base
char * buffer_
 Pointer to the buffer. More...
 
size_t size_
 Size of the buffer. More...
 
size_t offset_
 Pointer to the current offset in the <buffer_>. More...
 

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: