zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TPoolAllocator Class Reference

#include <PoolAlloc.h>

Classes

struct  tAllocState
 
struct  tHeader
 

Public Member Functions

 TPoolAllocator (int growthIncrement=8 *1024, int allocationAlignment=16)
 
 ~TPoolAllocator ()
 
voidallocate (size_t numBytes)
 
void pop ()
 
void popAll ()
 
void push ()
 

Protected Types

typedef std::vector< tAllocStatetAllocStack
 

Protected Member Functions

voidinitializeAllocation (tHeader *block, unsigned char *memory, size_t numBytes)
 

Protected Attributes

size_t alignment
 
size_t alignmentMask
 
size_t currentPageOffset
 
tHeaderfreeList
 
size_t headerSkip
 
tHeaderinUseList
 
int numCalls
 
size_t pageSize
 
tAllocStack stack
 
size_t totalBytes
 

Friends

struct tHeader
 

Detailed Description

Definition at line 116 of file PoolAlloc.h.

Member Typedef Documentation

typedef std::vector<tAllocState> TPoolAllocator::tAllocStack
protected

Definition at line 185 of file PoolAlloc.h.

Constructor & Destructor Documentation

TPoolAllocator::TPoolAllocator ( int  growthIncrement = 8*1024,
int  allocationAlignment = 16 
)

Definition at line 52 of file PoolAlloc.cpp.

References alignment, alignmentMask, currentPageOffset, headerSkip, pageSize, and tHeader.

TPoolAllocator::~TPoolAllocator ( )

Member Function Documentation

void* TPoolAllocator::initializeAllocation ( tHeader block,
unsigned char *  memory,
size_t  numBytes 
)
inlineprotected

Definition at line 188 of file PoolAlloc.h.

References TAllocation::offsetAllocation().

Referenced by allocate().

void TPoolAllocator::popAll ( )

Definition at line 200 of file PoolAlloc.cpp.

References pop(), and stack.

Referenced by TShHandleBase::~TShHandleBase().

void TPoolAllocator::push ( )

Definition at line 152 of file PoolAlloc.cpp.

References currentPageOffset, inUseList, pageSize, and stack.

Referenced by TShHandleBase::TShHandleBase().

Friends And Related Function Documentation

friend struct tHeader
friend

Definition at line 156 of file PoolAlloc.h.

Referenced by allocate(), and TPoolAllocator().

Member Data Documentation

size_t TPoolAllocator::alignment
protected

Definition at line 198 of file PoolAlloc.h.

Referenced by TPoolAllocator().

size_t TPoolAllocator::alignmentMask
protected

Definition at line 200 of file PoolAlloc.h.

Referenced by allocate(), and TPoolAllocator().

size_t TPoolAllocator::currentPageOffset
protected

Definition at line 204 of file PoolAlloc.h.

Referenced by allocate(), pop(), push(), and TPoolAllocator().

tHeader* TPoolAllocator::freeList
protected

Definition at line 205 of file PoolAlloc.h.

Referenced by allocate(), pop(), and ~TPoolAllocator().

size_t TPoolAllocator::headerSkip
protected

Definition at line 201 of file PoolAlloc.h.

Referenced by allocate(), and TPoolAllocator().

tHeader* TPoolAllocator::inUseList
protected

Definition at line 206 of file PoolAlloc.h.

Referenced by allocate(), pop(), push(), and ~TPoolAllocator().

int TPoolAllocator::numCalls
protected

Definition at line 209 of file PoolAlloc.h.

Referenced by allocate().

size_t TPoolAllocator::pageSize
protected

Definition at line 197 of file PoolAlloc.h.

Referenced by allocate(), push(), and TPoolAllocator().

tAllocStack TPoolAllocator::stack
protected

Definition at line 207 of file PoolAlloc.h.

Referenced by pop(), popAll(), and push().

size_t TPoolAllocator::totalBytes
protected

Definition at line 210 of file PoolAlloc.h.

Referenced by allocate().


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