L4Re - L4 Runtime Environment
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
cxx::List_alloc Class Reference

Standard list-based allocator. More...

+ Collaboration diagram for cxx::List_alloc:

Public Member Functions

 List_alloc ()
 Initializes an empty list allocator.
void free (void *block, unsigned long size, bool initial_free=false)
 Return a free memory block to the allocator.
void * alloc (unsigned long size, unsigned align)
 Alloc a memory block.
unsigned long avail ()
 Get the amount of available memory.

Detailed Description

Standard list-based allocator.

Definition at line 30 of file list_alloc.

Constructor & Destructor Documentation

cxx::List_alloc::List_alloc ( )
inline

Initializes an empty list allocator.

Note
To initialize the allocator with available memory use the free() function.

Definition at line 55 of file list_alloc.

Member Function Documentation

void cxx::List_alloc::free ( void *  block,
unsigned long  size,
bool  initial_free = false 
)
inline

Return a free memory block to the allocator.

Parameters
blockpointer to memory block
sizesize of memory block
initial_freeSet to true for putting fresh memory to the allocator. This will enforce alignment on that memory.

Definition at line 200 of file list_alloc.

void * cxx::List_alloc::alloc ( unsigned long  size,
unsigned  align 
)
inline

Alloc a memory block.

Parameters
sizeSize of the memory block
alignAlignment constraint
Returns
Pointer to memory block

Definition at line 238 of file list_alloc.

unsigned long cxx::List_alloc::avail ( )
inline

Get the amount of available memory.

Returns
Available memory in bytes

Definition at line 309 of file list_alloc.


The documentation for this class was generated from the following file:
L4Re - L4 Runtime Environment