zenilib: TPoolAllocator Class Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
TPoolAllocator Class Reference

`#include <PoolAlloc.h>`

## Classes

struct | tAllocState
struct | tHeader

## Public Member Functions

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

## Protected Types

typedef std::vector< tAllocState > | tAllocStack

## Protected Member Functions

void * | initializeAllocation (tHeader *block, unsigned char *memory, size_t numBytes)

## Protected Attributes

size_t | alignment
size_t | alignmentMask
size_t | currentPageOffset
tHeader * | freeList
size_t | headerSkip
tHeader * | inUseList
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 | ( |  | ) |

Definition at line 96 of file PoolAlloc.cpp.

References freeList, inUseList, TPoolAllocator::tHeader::nextPage, and TPoolAllocator::tHeader::~tHeader().

## Member Function Documentation

void * TPoolAllocator::allocate | ( | size_t | numBytes | ) |

Definition at line 206 of file PoolAlloc.cpp.

References alignmentMask, TAllocation::allocationSize(), currentPageOffset, freeList, headerSkip, initializeAllocation(), inUseList, TPoolAllocator::tHeader::nextPage, numCalls, pageSize, ret, tHeader, and totalBytes.

Referenced by pool_allocator< T >::allocate(), NewPoolTFieldList(), and NewPoolTString().

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::pop | ( |  | ) |

Definition at line 171 of file PoolAlloc.cpp.

References currentPageOffset, freeList, inUseList, TPoolAllocator::tHeader::nextPage, TPoolAllocator::tHeader::pageCount, stack, and TPoolAllocator::tHeader::~tHeader().

Referenced by popAll().

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:

- zenilib/jni/external/angle/src/compiler/PoolAlloc.h
- zenilib/jni/external/angle/src/compiler/PoolAlloc.cpp