Class MemoryManager handles allocation and deallocation of raw memory (stack) provided at runtime of the library.
More...
#include <memory.h>
|
|
typedef intptr_t | Address |
| | Negative Address is used to denote an invalid address – hence signed integer.
|
| |
|
typedef size_t | Size |
| |
|
typedef MemoryBlock< Address, Size > | MemBlock |
| |
|
| virtual Address | alloc (const Size &size)=0 |
| | Reserve a block and return its address.
|
| |
|
virtual void | free (const Address &address) |
| | Release a block previously reserved using alloc.
|
| |
|
Size | max_memory_used () const |
| | Returns the max amount of memory used up to this moment.
|
| |
|
void | reset () |
| | resets the state of MemoryManager; does not invalidate stats, however
|
| |
|
|
static const Address | InvalidAddress = -1 |
| |
|
|
typedef std::list< std::shared_ptr< MemBlock > > | memblkset |
| |
|
|
| MemoryManager (const Size &maxmem) |
| |
|
Size | maxmem () const |
| | Returns maxmem.
|
| |
|
memblkset & | blocks () |
| | Returns blocks.
|
| |
|
std::shared_ptr< MemBlock > | superblock () const |
| | Returns the superblock.
|
| |
|
std::shared_ptr< MemBlock > | steal_from_block (const std::shared_ptr< MemBlock > &blk, const Size &size) |
| | steals size memory from block blk and returns the new block
|
| |
|
std::shared_ptr< MemBlock > | find_block (const Address &a) |
| | finds the block at Address a
|
| |
Class MemoryManager handles allocation and deallocation of raw memory (stack) provided at runtime of the library.
◆ alloc()
| virtual Address libint2::MemoryManager::alloc |
( |
const Size & | size | ) |
|
|
pure virtual |
The documentation for this class was generated from the following files: