GCpp::MemoryAllocatorBase Class Reference

Allocator. More...

#include <memory_manager.hpp>

Inheritance diagram for GCpp::MemoryAllocatorBase:

Inheritance graph
Collaboration diagram for GCpp::MemoryAllocatorBase:

Collaboration graph

List of all members.

Public Member Functions

 ~MemoryAllocatorBase ()
size_t destroyed ()
size_t allocated ()
void * malloc ()
 allocate one block for an object
void * confirm (void *p_storage)
 helper for weak pointer

Public Attributes

 implementation detail
 implementation detail

Protected Member Functions

 MemoryAllocatorBase (size_t f_block_size)
void * internal_malloc ()
void * internal_add_block ()
size_t block_size () const
void free (void *p_block)

Protected Attributes

DestroyItem f_destroy_item
 pointer to object destructor

Detailed Description


This class manages the memory allocation and deallocations for a specific type. The binding to a certain type is provided by a templated descendent.

Definition at line 22 of file memory_manager.hpp.

Member Function Documentation

void * MemoryAllocatorBase::confirm ( void *  p_storage  ) 

helper for weak pointer

Checks, if the given pointer represents a valid block managed by this.

p_storage if valid, 0 if not

Definition at line 213 of file memory_manager.cxx.

void * FixedSizeAllocator::internal_malloc (  )  [protected, inherited]


Tries to find an unused block and returns a pointer to it.

valid pointer or 0 if no free block is left

Definition at line 310 of file fixed_size_allocator.cxx.

void * FixedSizeAllocator::internal_add_block (  )  [protected, inherited]


Forces the allocator to add a new set of unused blocks to its internal list and allocates one block of the newly added set immediatly.

valid pointer
bad_alloc internal allocation failed

Definition at line 341 of file fixed_size_allocator.cxx.

size_t GCpp::FixedSizeAllocator::block_size (  )  const [inline, protected, inherited]


size of blocks

Definition at line 126 of file fixed_size_allocator.hpp.

void FixedSizeAllocator::free ( void *  p_block  )  [inherited]


Releases a block of memory to the allocator. Will be kept for later usage.

p_block a block previously allocated with malloc

Definition at line 256 of file fixed_size_allocator.cxx.

The documentation for this class was generated from the following files:
Generated on Thu Dec 27 14:02:01 2007 for GC++ by  doxygen 1.5.4