cgma
|
#include <MemoryBlock.hpp>
Public Member Functions | |
MemoryBlock (MemoryBlock *Head, char *Block, int Size) | |
~MemoryBlock () | |
int | get_memory_allocation () |
MemoryBlock * | next_block () const |
void | next_block (MemoryBlock *next_block) |
int | block_size () const |
char * | get_block () const |
Private Attributes | |
char * | block |
int | size |
MemoryBlock * | next |
Definition at line 15 of file MemoryBlock.hpp.
MemoryBlock::MemoryBlock | ( | MemoryBlock * | Head, |
char * | Block, | ||
int | Size | ||
) | [inline] |
Definition at line 28 of file MemoryBlock.hpp.
int MemoryBlock::block_size | ( | ) | const [inline] |
Definition at line 59 of file MemoryBlock.hpp.
{ return size; }
char * MemoryBlock::get_block | ( | ) | const [inline] |
Definition at line 64 of file MemoryBlock.hpp.
{ return block; }
Definition at line 25 of file MemoryBlock.cpp.
{ MemoryBlock* block_ptr = this; // sum all allocated memory int amount = 0; while (block_ptr) { amount += block_ptr->size; block_ptr = block_ptr->next; } return amount; }
MemoryBlock * MemoryBlock::next_block | ( | ) | const [inline] |
Definition at line 49 of file MemoryBlock.hpp.
{ return next; }
void MemoryBlock::next_block | ( | MemoryBlock * | next_block | ) | [inline] |
Definition at line 54 of file MemoryBlock.hpp.
{ next = nxt_blck; }
char* MemoryBlock::block [private] |
Definition at line 19 of file MemoryBlock.hpp.
MemoryBlock* MemoryBlock::next [private] |
Definition at line 21 of file MemoryBlock.hpp.
int MemoryBlock::size [private] |
Definition at line 20 of file MemoryBlock.hpp.