GCpp::MemoryAllocator< T > Class Template Reference

the 'real' type bound memory manager More...

#include <memory_manager.hpp>

Inheritance diagram for GCpp::MemoryAllocator< T >:

Inheritance graph
[legend]
Collaboration diagram for GCpp::MemoryAllocator< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

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

Public Attributes

MemoryAllocatorBasenext
 implementation detail
MemoryAllocatorBaseprior
 implementation detail

Protected Member Functions

void * internal_malloc ()
 Allocation.
void * internal_add_block ()
 Allocation.
size_t block_size () const
 Info.
void free (void *p_block)
 Allocation.

Protected Attributes

DestroyItem f_destroy_item
 pointer to object destructor


Detailed Description

template<class T>
class GCpp::MemoryAllocator< T >

the 'real' type bound memory manager

Definition at line 132 of file memory_manager.hpp.


Member Function Documentation

void * MemoryAllocatorBase::confirm ( void *  p_storage  )  [inherited]

helper for weak pointer

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

Returns:
p_storage if valid, 0 if not

Definition at line 213 of file memory_manager.cxx.

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

Allocation.

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

Returns:
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]

Allocation.

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.

Returns:
valid pointer
Exceptions:
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]

Info.

Returns:
size of blocks

Definition at line 126 of file fixed_size_allocator.hpp.

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

Allocation.

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

Parameters:
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 file:
Generated on Thu Dec 27 14:02:01 2007 for GC++ by  doxygen 1.5.4