panda3d.core.SimpleAllocatorBlock

class SimpleAllocatorBlock

Bases: LinkedListNode

A single block as returned from SimpleAllocator.alloc().

Inheritance diagram

Inheritance diagram of SimpleAllocatorBlock

free() → None

Releases the allocated space.

getAllocator() → SimpleAllocator

Returns the SimpleAllocator object that owns this block. Returns NULL if the block has been freed.

Return type

SimpleAllocator

getStart() → size_t

Returns the starting point of this block. It is an error to call this if the block has been freed.

Return type

size_t

getSize() → size_t

Returns the size of this block. It is an error to call this if the block has been freed.

Return type

size_t

isFree() → bool

Returns true if the block has been freed, false if it is still valid.

getMaxSize() → size_t

Returns the maximum size this block can be reallocated to, as limited by the following block.

Return type

size_t

realloc(size: size_t) → bool

Changes the size of this block to the specified size. Returns true if the change is accepted, false if there was not enough room.

getNextBlock() → SimpleAllocatorBlock

Returns a pointer to the next allocated block in the chain, or NULL if there are no more allocated blocks.

Return type

SimpleAllocatorBlock

output(out: ostream) → None