Classes | Public Member Functions | Protected Member Functions | Protected Attributes

DataStructures::MemoryPool< MemoryBlockType > Class Template Reference

#include <DS_MemoryPool.h>

Collaboration diagram for DataStructures::MemoryPool< MemoryBlockType >:
Collaboration graph
[legend]

List of all members.

Classes

struct  MemoryWithPage
struct  Page

Public Member Functions

 MemoryPool ()
 ~MemoryPool ()
void SetPageSize (int size)
MemoryBlockType * Allocate (const char *file, unsigned int line)
void Release (MemoryBlockType *m, const char *file, unsigned int line)
void Clear (const char *file, unsigned int line)
int GetAvailablePagesSize (void) const
int GetUnavailablePagesSize (void) const
int GetMemoryPoolPageSize (void) const

Protected Member Functions

int BlocksPerPage (void) const
void AllocateFirst (void)
bool InitPage (Page *page, Page *prev, const char *file, unsigned int line)

Protected Attributes

PageavailablePages
PageunavailablePages
int availablePagesSize
int unavailablePagesSize
int memoryPoolPageSize

Detailed Description

template<class MemoryBlockType>
class DataStructures::MemoryPool< MemoryBlockType >

Very fast memory pool for allocating and deallocating structures that don't have constructors or destructors. Contains a list of pages, each of which has an array of the user structures

Definition at line 29 of file DS_MemoryPool.h.


Constructor & Destructor Documentation

template<class MemoryBlockType >
DataStructures::MemoryPool< MemoryBlockType >::MemoryPool (  ) 

Definition at line 71 of file DS_MemoryPool.h.

template<class MemoryBlockType >
DataStructures::MemoryPool< MemoryBlockType >::~MemoryPool (  ) 

Definition at line 81 of file DS_MemoryPool.h.

Here is the call graph for this function:


Member Function Documentation

template<class MemoryBlockType >
MemoryBlockType * DataStructures::MemoryPool< MemoryBlockType >::Allocate ( const char *  file,
unsigned int  line 
)

Definition at line 95 of file DS_MemoryPool.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class MemoryBlockType>
void DataStructures::MemoryPool< MemoryBlockType >::AllocateFirst ( void   )  [protected]
template<class MemoryBlockType >
int DataStructures::MemoryPool< MemoryBlockType >::BlocksPerPage ( void   )  const [protected]

Definition at line 262 of file DS_MemoryPool.h.

Here is the caller graph for this function:

template<class MemoryBlockType >
void DataStructures::MemoryPool< MemoryBlockType >::Clear ( const char *  file,
unsigned int  line 
)

Definition at line 209 of file DS_MemoryPool.h.

Here is the caller graph for this function:

template<class MemoryBlockType>
int DataStructures::MemoryPool< MemoryBlockType >::GetAvailablePagesSize ( void   )  const [inline]

Definition at line 54 of file DS_MemoryPool.h.

template<class MemoryBlockType>
int DataStructures::MemoryPool< MemoryBlockType >::GetMemoryPoolPageSize ( void   )  const [inline]

Definition at line 56 of file DS_MemoryPool.h.

template<class MemoryBlockType>
int DataStructures::MemoryPool< MemoryBlockType >::GetUnavailablePagesSize ( void   )  const [inline]

Definition at line 55 of file DS_MemoryPool.h.

template<class MemoryBlockType >
bool DataStructures::MemoryPool< MemoryBlockType >::InitPage ( Page page,
Page prev,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 267 of file DS_MemoryPool.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class MemoryBlockType>
void DataStructures::MemoryPool< MemoryBlockType >::Release ( MemoryBlockType *  m,
const char *  file,
unsigned int  line 
)

Definition at line 147 of file DS_MemoryPool.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class MemoryBlockType >
void DataStructures::MemoryPool< MemoryBlockType >::SetPageSize ( int  size  ) 

Definition at line 89 of file DS_MemoryPool.h.

Here is the caller graph for this function:


Member Data Documentation

template<class MemoryBlockType>
Page* DataStructures::MemoryPool< MemoryBlockType >::availablePages [protected]

Definition at line 65 of file DS_MemoryPool.h.

template<class MemoryBlockType>
int DataStructures::MemoryPool< MemoryBlockType >::availablePagesSize [protected]

Definition at line 66 of file DS_MemoryPool.h.

template<class MemoryBlockType>
int DataStructures::MemoryPool< MemoryBlockType >::memoryPoolPageSize [protected]

Definition at line 67 of file DS_MemoryPool.h.

template<class MemoryBlockType>
Page * DataStructures::MemoryPool< MemoryBlockType >::unavailablePages [protected]

Definition at line 65 of file DS_MemoryPool.h.

template<class MemoryBlockType>
int DataStructures::MemoryPool< MemoryBlockType >::unavailablePagesSize [protected]

Definition at line 66 of file DS_MemoryPool.h.


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