ScummVM API documentation
Common::FixedSizeMemoryPool< CHUNK_SIZE, NUM_INTERNAL_CHUNKS > Class Template Reference

#include <memorypool.h>

Inheritance diagram for Common::FixedSizeMemoryPool< CHUNK_SIZE, NUM_INTERNAL_CHUNKS >:
Common::MemoryPool

Additional Inherited Members

- Public Member Functions inherited from Common::MemoryPool
 MemoryPool (size_t chunkSize)
 
void * allocChunk ()
 
void freeChunk (void *ptr)
 
void freeUnusedPages ()
 
size_t getChunkSize () const
 
- 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<size_t CHUNK_SIZE, size_t NUM_INTERNAL_CHUNKS = 32>
class Common::FixedSizeMemoryPool< CHUNK_SIZE, NUM_INTERNAL_CHUNKS >

This is a memory pool which already contains in itself some storage space for a fixed number of chunks. Thus if the memory pool is only lightly used, no malloc() calls have to be made at all.


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