Jpp
19.1.0
the software that should make you happy
|
Low-level memory management. More...
#include <JAllocator.hh>
Public Types | |
typedef unsigned short | JBlock_t |
Public Member Functions | |
JAllocatorBuffer (const std::size_t block_size, const JBlock_t number_of_blocks) | |
Constructor. More... | |
void * | allocate (const std::size_t block_size) |
Allocate memory. More... | |
void | free (void *p, const std::size_t block_size) |
Deallocate memory. More... | |
Public Attributes | |
unsigned char * | buffer |
JBlock_t | firstAvailableBlock |
JBlock_t | numberOfFreeBlocks |
Low-level memory management.
Source code is taken from reference: A. Alexandrescu, Modern C++ Design, Addison Wesley.
Definition at line 26 of file JAllocator.hh.
typedef unsigned short JLANG::JAllocatorBuffer::JBlock_t |
Definition at line 28 of file JAllocator.hh.
|
inline |
Constructor.
block_size | number of bytes |
number_of_blocks | number of blocks |
Definition at line 37 of file JAllocator.hh.
|
inline |
Allocate memory.
block_size | number of bytes |
Definition at line 65 of file JAllocator.hh.
|
inline |
Deallocate memory.
p | pointer to memory to be freed |
block_size | number of bytes |
Definition at line 83 of file JAllocator.hh.
unsigned char* JLANG::JAllocatorBuffer::buffer |
Definition at line 103 of file JAllocator.hh.
JBlock_t JLANG::JAllocatorBuffer::firstAvailableBlock |
Definition at line 104 of file JAllocator.hh.
JBlock_t JLANG::JAllocatorBuffer::numberOfFreeBlocks |
Definition at line 105 of file JAllocator.hh.