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

Common::FixedSizeMemoryPool< CHUNK_SIZE, NUM_INTERNAL_CHUNKS > Class Template Reference

This is a memory pool which already contains in itself some storage space for a fixed number of chunks. More...

#include <memorypool.h>

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

List of all members.

Public Member Functions

 FixedSizeMemoryPool ()

Private Types

enum  { REAL_CHUNK_SIZE = (CHUNK_SIZE + sizeof(void *) - 1) & (~(sizeof(void *) - 1)) }

Private Attributes

byte _storage [NUM_INTERNAL_CHUNKS *REAL_CHUNK_SIZE]

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.

Definition at line 105 of file memorypool.h.


Member Enumeration Documentation

template<size_t CHUNK_SIZE, size_t NUM_INTERNAL_CHUNKS = 32>
anonymous enum [private]
Enumerator:
REAL_CHUNK_SIZE 

Definition at line 107 of file memorypool.h.


Constructor & Destructor Documentation

template<size_t CHUNK_SIZE, size_t NUM_INTERNAL_CHUNKS = 32>
Common::FixedSizeMemoryPool< CHUNK_SIZE, NUM_INTERNAL_CHUNKS >::FixedSizeMemoryPool (  )  [inline]

Definition at line 113 of file memorypool.h.


Member Data Documentation

template<size_t CHUNK_SIZE, size_t NUM_INTERNAL_CHUNKS = 32>
byte Common::FixedSizeMemoryPool< CHUNK_SIZE, NUM_INTERNAL_CHUNKS >::_storage[NUM_INTERNAL_CHUNKS *REAL_CHUNK_SIZE] [private]

Definition at line 111 of file memorypool.h.


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


Generated on Sat May 18 2019 05:06:01 for ResidualVM by doxygen 1.7.1
curved edge   curved edge