SimpleAllocatorBlock

from panda3d.core import SimpleAllocatorBlock
class SimpleAllocatorBlock

Bases:

Bases: LinkedListNode

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

Inheritance diagram

Inheritance diagram of SimpleAllocatorBlock

free()

Releases the allocated space.

get_allocator() SimpleAllocator

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

get_max_size() int

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

get_next_block() SimpleAllocatorBlock

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

get_size() int

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

get_start() int

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

is_free() bool

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

output(out: ostream)
realloc(size: int) 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.