Panda3D
|
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. | |
~SimpleAllocatorBlock () | |
The block automatically frees itself when it destructs. | |
void | free () |
Releases the allocated space. | |
SimpleAllocator * | get_allocator () const |
Returns the SimpleAllocator object that owns this block. | |
size_t | get_max_size () const |
Returns the maximum size this block can be reallocated to, as limited by the following block. | |
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. | |
size_t | get_size () const |
Returns the size of this block. | |
size_t | get_start () const |
Returns the starting point of this block. | |
bool | is_free () const |
Returns true if the block has been freed, false if it is still valid. | |
SimpleAllocatorBlock & | operator= (const SimpleAllocatorBlock ©)=delete |
SimpleAllocatorBlock & | operator= (SimpleAllocatorBlock &&from) |
Frees this block and instead takes ownership of the given other block. | |
void | output (std::ostream &out) const |
bool | realloc (size_t size) |
Changes the size of this block to the specified size. | |
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 154 of file simpleAllocator.I.
|
inline |
The block automatically frees itself when it destructs.
Definition at line 172 of file simpleAllocator.I.
References free().
|
inline |
Releases the allocated space.
Definition at line 202 of file simpleAllocator.I.
Referenced by ~SimpleAllocatorBlock(), and operator=().
|
inline |
Returns the SimpleAllocator object that owns this block.
Returns NULL if the block has been freed.
Definition at line 214 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 251 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 273 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 233 of file simpleAllocator.I.
Referenced by VertexDataSaveFile::read_data().
|
inline |
Returns the starting point of this block.
It is an error to call this if the block has been freed.
Definition at line 223 of file simpleAllocator.I.
Referenced by VertexDataBlock::get_pointer(), and VertexDataSaveFile::read_data().
|
inline |
Returns true if the block has been freed, false if it is still valid.
Definition at line 242 of file simpleAllocator.I.
|
inline |
Frees this block and instead takes ownership of the given other block.
Definition at line 180 of file simpleAllocator.I.
References free().
void SimpleAllocatorBlock::output | ( | std::ostream & | out | ) | const |
Definition at line 203 of file simpleAllocator.cxx.
|
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 262 of file simpleAllocator.I.
|
friend |
Definition at line 130 of file simpleAllocator.h.