SimpleAllocatorBlock

from acron.core import SimpleAllocatorBlock
class SimpleAllocatorBlock

Bases:

Bases: LinkedListNode

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

Inheritance diagram

digraph inheritancee726eaf39c { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "SimpleAllocatorBlock" [URL="acron.core.SimpleAllocatorBlock.html#acron.core.SimpleAllocatorBlock",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "SimpleAllocatorBlock" [arrowsize=0.75,style=""]; }
free()

Releases the allocated space.

get_allocator()

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

get_max_size()

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

get_next_block()

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

get_size()

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

get_start()

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

is_free()

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

output()
realloc()

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