IRC_SERVER
By @hyunjunk (hyunjun2372@gmail.com)
|
A memory pool that can allocate flexible number of data. More...
#include <FlexibleFixedMemoryPool.hpp>
Classes | |
struct | Block |
Public Member Functions | |
FlexibleFixedMemoryPool () | |
~FlexibleFixedMemoryPool () | |
T * | Allocate () |
void | Deallocate (T *ptr) |
Private Types | |
enum | { BLOCK_SIZE = sizeof(Block) } |
enum | { CHUNK_MEMORY_PAGE_CAPACITY = (BLOCK_SIZE * MinNumDataPerChunk + PAGE_SIZE - 1) / PAGE_SIZE } |
Private Attributes | |
std::vector< FixedMemoryPool< Block, CHUNK_MEMORY_PAGE_CAPACITY > * > | mChunks |
size_t | mChunkCursor |
Index of the first chunk among the chunks with empty space. | |
Friends | |
class | FixedMemoryPool< Block, CHUNK_MEMORY_PAGE_CAPACITY > |
A memory pool that can allocate flexible number of data.
T | Type of data to allocate. |
MinNumDataPerChunk | Minimum number of data to allocate per chunk |
|
private |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
|
private |
|
private |
Index of the first chunk among the chunks with empty space.