ScummVM API documentation
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

Public Member Functions

void deleteChunk (T *ptr)
 
- Public Member Functions inherited from Common::MemoryPool
 MemoryPool (size_t chunkSize)
 
void * allocChunk ()
 
void freeChunk (void *ptr)
 
void freeUnusedPages ()
 
size_t getChunkSize () const
 

Additional Inherited Members

- Protected Member Functions inherited from Common::MemoryPool
 MemoryPool (const MemoryPool &)
 
MemoryPooloperator= (const MemoryPool &)
 
void allocPage ()
 
void addPageToPool (const Page &page)
 
bool isPointerInPage (void *ptr, const Page &page)
 
- Protected Attributes inherited from Common::MemoryPool
const size_t _chunkSize
 
Array< Page_pages
 
void * _next
 
size_t _chunksPerPage
 

Detailed Description

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

A memory pool for C++ objects.

Member Function Documentation

◆ deleteChunk()

template<class T, size_t NUM_INTERNAL_CHUNKS = 32>
void Common::ObjectPool< T, NUM_INTERNAL_CHUNKS >::deleteChunk ( T *  ptr)
inline

Return the memory chunk used as storage for the given object back to the pool, after calling its destructor.


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