A single block as returned from SimpleAllocator::alloc(). More...
#include "simpleAllocator.h"
Public Member Functions | |
SimpleAllocatorBlock (const SimpleAllocatorBlock ©)=delete | |
SimpleAllocatorBlock (SimpleAllocatorBlock &&from) | |
Transfers ownership from the given SimpleAllocatorBlock to this one. More... | |
~SimpleAllocatorBlock () | |
The block automatically frees itself when it destructs. More... | |
void | free () |
Releases the allocated space. More... | |
SimpleAllocator * | get_allocator () const |
Returns the SimpleAllocator object that owns this block. More... | |
size_t | get_max_size () const |
Returns the maximum size this block can be reallocated to, as limited by the following block. More... | |
SimpleAllocatorBlock * | get_next_block () const |
Returns a pointer to the next allocated block in the chain, or NULL if there are no more allocated blocks. More... | |
size_t | get_size () const |
Returns the size of this block. More... | |
size_t | get_start () const |
Returns the starting point of this block. More... | |
bool | is_free () const |
Returns true if the block has been freed, false if it is still valid. More... | |
SimpleAllocatorBlock & | operator= (const SimpleAllocatorBlock ©)=delete |
SimpleAllocatorBlock & | operator= (SimpleAllocatorBlock &&from) |
Frees this block and instead takes ownership of the given other block. More... | |
void | output (std::ostream &out) const |
bool | realloc (size_t size) |
Changes the size of this block to the specified size. More... | |
Friends | |
class | SimpleAllocator |
A single block as returned from SimpleAllocator::alloc().
Definition at line 90 of file simpleAllocator.h.
|
inline |
Transfers ownership from the given SimpleAllocatorBlock to this one.
Definition at line 155 of file simpleAllocator.I.
|
inline |
The block automatically frees itself when it destructs.
Definition at line 173 of file simpleAllocator.I.
References free().
|
inline |
Releases the allocated space.
Definition at line 203 of file simpleAllocator.I.
Referenced by operator=(), and ~SimpleAllocatorBlock().
|
inline |
Returns the SimpleAllocator object that owns this block.
Returns NULL if the block has been freed.
Definition at line 215 of file simpleAllocator.I.
Referenced by VertexDataBlock::get_page().
|
inline |
Returns the maximum size this block can be reallocated to, as limited by the following block.
Definition at line 252 of file simpleAllocator.I.
|
inline |
Returns a pointer to the next allocated block in the chain, or NULL if there are no more allocated blocks.
Definition at line 274 of file simpleAllocator.I.
Referenced by VertexDataBlock::get_next_block().
|
inline |
Returns the size of this block.
It is an error to call this if the block has been freed.
Definition at line 234 of file simpleAllocator.I.
|
inline |
Returns the starting point of this block.
It is an error to call this if the block has been freed.
Definition at line 224 of file simpleAllocator.I.
|
inline |
Returns true if the block has been freed, false if it is still valid.
Definition at line 243 of file simpleAllocator.I.
|
inline |
Frees this block and instead takes ownership of the given other block.
Definition at line 181 of file simpleAllocator.I.
References free().
|
inline |
Changes the size of this block to the specified size.
Returns true if the change is accepted, false if there was not enough room.
Definition at line 263 of file simpleAllocator.I.