ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

TinyGL::LinearAllocator Class Reference

A linear allocator implementation. More...

#include <zgl.h>

List of all members.

Public Member Functions

 LinearAllocator ()
void initialize (size_t newSize)
 ~LinearAllocator ()
void * allocate (size_t size)
void reset ()

Private Attributes

void * _memoryBuffer
size_t _memorySize
size_t _memoryPosition

Detailed Description

A linear allocator implementation.

The allocator can be initialized to a specific buffer size only once. The allocation scheme is pretty simple: pointers are returned relative to a current memory position, the allocator starts with an offset of 0 and increases its offset by the allocated amount every time. Memory is released through the method free(), care has to be taken to call the destructors of the deallocated objects either manually (for complex struct arrays) or by overriding the delete operator (with an empty implementation).

Definition at line 208 of file zgl.h.


Constructor & Destructor Documentation

TinyGL::LinearAllocator::LinearAllocator (  )  [inline]

Definition at line 210 of file zgl.h.

TinyGL::LinearAllocator::~LinearAllocator (  )  [inline]

Definition at line 226 of file zgl.h.


Member Function Documentation

void* TinyGL::LinearAllocator::allocate ( size_t  size  )  [inline]

Definition at line 232 of file zgl.h.

void TinyGL::LinearAllocator::initialize ( size_t  newSize  )  [inline]

Definition at line 216 of file zgl.h.

void TinyGL::LinearAllocator::reset (  )  [inline]

Definition at line 241 of file zgl.h.


Member Data Documentation

Definition at line 245 of file zgl.h.

Definition at line 247 of file zgl.h.

Definition at line 246 of file zgl.h.


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


Generated on Sat Jul 20 2019 05:03:38 for ResidualVM by doxygen 1.7.1
curved edge   curved edge