Jpp
15.0.5
the software that should make you happy
|
Memory management for small objects. More...
#include <JAllocator.hh>
Public Member Functions | |
JAllocator (const std::size_t block_size, const JBlock_t number_of_blocks=std::numeric_limits< JBlock_t >::max()) | |
Constructor. More... | |
long long int | getTotalRAM () |
Get total used RAM. More... | |
long long int | getFreeRAM () |
Get total free RAM. More... | |
void * | allocate () |
Allocate memory. More... | |
void | free (void *p) |
Deallocate memory. More... | |
Private Types | |
typedef JAllocatorBuffer::JBlock_t | JBlock_t |
Private Attributes | |
std::size_t | BLOCK_SIZE |
JBlock_t | numberOfBlocks |
JAllocatorBuffer * | pAlloc |
JAllocatorBuffer * | pDealloc |
Memory management for small objects.
This object allocator consitutes a comprimise between speed and memory overhead.
Source code is taken from reference: A. Alexandrescu, Modern C++ Design, Addison Wesley.
Definition at line 116 of file JAllocator.hh.
|
private |
Definition at line 121 of file JAllocator.hh.
|
inline |
Constructor.
block_size | number of bytes |
number_of_blocks | number of blocks |
Definition at line 136 of file JAllocator.hh.
|
inline |
|
inline |
|
inline |
Allocate memory.
Definition at line 179 of file JAllocator.hh.
|
inline |
Deallocate memory.
p | pointer to memory to be freed |
Definition at line 219 of file JAllocator.hh.
|
private |
Definition at line 123 of file JAllocator.hh.
|
private |
Definition at line 124 of file JAllocator.hh.
|
private |
Definition at line 126 of file JAllocator.hh.
|
private |
Definition at line 127 of file JAllocator.hh.