#include <DS_MemoryPool.h>
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 | |
Page * | availablePages |
Page * | unavailablePages |
int | availablePagesSize |
int | unavailablePagesSize |
int | memoryPoolPageSize |
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.
DataStructures::MemoryPool< MemoryBlockType >::MemoryPool | ( | ) |
Definition at line 71 of file DS_MemoryPool.h.
DataStructures::MemoryPool< MemoryBlockType >::~MemoryPool | ( | ) |
MemoryBlockType * DataStructures::MemoryPool< MemoryBlockType >::Allocate | ( | const char * | file, | |
unsigned int | line | |||
) |
Definition at line 95 of file DS_MemoryPool.h.
void DataStructures::MemoryPool< MemoryBlockType >::AllocateFirst | ( | void | ) | [protected] |
int DataStructures::MemoryPool< MemoryBlockType >::BlocksPerPage | ( | void | ) | const [protected] |
void DataStructures::MemoryPool< MemoryBlockType >::Clear | ( | const char * | file, | |
unsigned int | line | |||
) |
int DataStructures::MemoryPool< MemoryBlockType >::GetAvailablePagesSize | ( | void | ) | const [inline] |
Definition at line 54 of file DS_MemoryPool.h.
int DataStructures::MemoryPool< MemoryBlockType >::GetMemoryPoolPageSize | ( | void | ) | const [inline] |
Definition at line 56 of file DS_MemoryPool.h.
int DataStructures::MemoryPool< MemoryBlockType >::GetUnavailablePagesSize | ( | void | ) | const [inline] |
Definition at line 55 of file DS_MemoryPool.h.
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.
void DataStructures::MemoryPool< MemoryBlockType >::Release | ( | MemoryBlockType * | m, | |
const char * | file, | |||
unsigned int | line | |||
) |
Definition at line 147 of file DS_MemoryPool.h.
void DataStructures::MemoryPool< MemoryBlockType >::SetPageSize | ( | int | size | ) |
Page* DataStructures::MemoryPool< MemoryBlockType >::availablePages [protected] |
Definition at line 65 of file DS_MemoryPool.h.
int DataStructures::MemoryPool< MemoryBlockType >::availablePagesSize [protected] |
Definition at line 66 of file DS_MemoryPool.h.
int DataStructures::MemoryPool< MemoryBlockType >::memoryPoolPageSize [protected] |
Definition at line 67 of file DS_MemoryPool.h.
Page * DataStructures::MemoryPool< MemoryBlockType >::unavailablePages [protected] |
Definition at line 65 of file DS_MemoryPool.h.
int DataStructures::MemoryPool< MemoryBlockType >::unavailablePagesSize [protected] |
Definition at line 66 of file DS_MemoryPool.h.