#include <Allocator.h>
Public Methods | |
Chunk (size_t blockSize) | |
construct a chunk of blockSize bytes. More... | |
bool | operator== (const Chunk &rhs) const |
provide comparison of chunks. More... | |
bool | operator!= (const Chunk &rhs) const |
void * | alloc () |
memory management interface. More... | |
void | dealloc (void *p) |
void | freeMemory () |
explicitely free memory. More... | |
unsigned char | blocksAvailable () const |
provide number of blocks available in this chunk. More... | |
bool | isUnused () const |
for cleanup purposes, provide check if chunk is entirely unused. More... | |
bool | isInsideBounds (void *p) const |
provide address checking. More... |
|
construct a chunk of blockSize bytes.
|
|
provide comparison of chunks. returns true if rhs equals this chunk |
|
returns true if rhs not equals this chunk |
|
memory management interface. get one block from chunk; returns NULL if no blocks available |
|
deallocate a block pointed to by p |
|
explicitely free memory. explicitely free chunk's raw memory |
|
provide number of blocks available in this chunk. provides number of blocks available in this chunk |
|
for cleanup purposes, provide check if chunk is entirely unused. for cleanup purposes, provide check if chunk is entirely unused |
|
provide address checking. returns true if the address given belongs to this chunk; false otherwise |