Panda3D
Public Member Functions | List of all members
SimpleAllocatorBlock Class Reference

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

Inheritance diagram for SimpleAllocatorBlock:
LinkedListNode VertexDataBlock

Public Member Functions

 free ()
 Releases the allocated space. More...
 
SimpleAllocator getAllocator ()
 Returns the SimpleAllocator object that owns this block. Returns NULL if the block has been freed. More...
 
size_t getMaxSize ()
 Returns the maximum size this block can be reallocated to, as limited by the following block. More...
 
SimpleAllocatorBlock getNextBlock ()
 Returns a pointer to the next allocated block in the chain, or NULL if there are no more allocated blocks. More...
 
size_t getSize ()
 Returns the size of this block. It is an error to call this if the block has been freed. More...
 
size_t getStart ()
 Returns the starting point of this block. It is an error to call this if the block has been freed. More...
 
bool isFree ()
 Returns true if the block has been freed, false if it is still valid. More...
 
 output (Ostream out)
 
bool realloc (size_t size)
 Changes the size of this block to the specified size. Returns true if the change is accepted, false if there was not enough room. More...
 

Detailed Description

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

Member Function Documentation

◆ free()

free ( )

Releases the allocated space.

◆ getAllocator()

SimpleAllocator getAllocator ( )

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

◆ getMaxSize()

size_t getMaxSize ( )

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

◆ getNextBlock()

SimpleAllocatorBlock getNextBlock ( )

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

◆ getSize()

size_t getSize ( )

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

◆ getStart()

size_t getStart ( )

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

◆ isFree()

bool isFree ( )

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

◆ output()

output ( Ostream  out)

◆ realloc()

bool realloc ( size_t  size)

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