#include <Allocator.h>
Public Member Functions | |
Chunk (size_t blockSize) | |
construct a chunk of blockSize bytes | |
bool | operator== (const Chunk &rhs) const |
provide comparison of chunks | |
bool | operator!= (const Chunk &rhs) const |
void * | alloc () |
memory management interface | |
void | dealloc (void *p) |
void | freeMemory () |
explicitely free memory | |
unsigned char | blocksAvailable () const |
provide number of blocks available in this chunk | |
bool | isUnused () const |
for cleanup purposes, provide check if chunk is entirely unused | |
bool | isInsideBounds (void *p) const |
provide address checking |
|
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 |