Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

Common::ObjectPool< T, NUM_INTERNAL_CHUNKS > Class Template Reference

#include <memorypool.h>

Inheritance diagram for Common::ObjectPool< T, NUM_INTERNAL_CHUNKS >:

Common::FixedSizeMemoryPool< sizeof(T), NUM_INTERNAL_CHUNKS > Common::MemoryPool

List of all members.


Detailed Description

template<class T, size_t NUM_INTERNAL_CHUNKS = 32>
class Common::ObjectPool< T, NUM_INTERNAL_CHUNKS >

A memory pool for C++ objects.

Definition at line 135 of file memorypool.h.


Public Member Functions

void * allocChunk ()
void deleteChunk (T *ptr)
void freeChunk (void *ptr)
void freeUnusedPages ()
size_t getChunkSize () const

Protected Member Functions

void addPageToPool (const Page &page)
void allocPage ()
bool isPointerInPage (void *ptr, const Page &page)

Protected Attributes

const size_t _chunkSize
size_t _chunksPerPage
void * _next
Array< Page > _pages

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

Generated by  Doxygen 1.6.0   Back to index