![]() |
L4Re Operating System Framework
Interface and Usage Documentation
|
Standard list-based allocator. More...
#include <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 long align, unsigned long lower=0, unsigned long upper=~0UL) |
| Allocate a memory block. | |
| void * | alloc_max (unsigned long min, unsigned long *max, unsigned long align, unsigned granularity, unsigned long lower=0, unsigned long upper=~0UL) |
| Allocate a memory block of min <= size <= max. | |
| unsigned long | avail () |
| Get the amount of available memory. | |
Standard list-based allocator.
Definition at line 21 of file list_alloc.
|
inline |
Initializes an empty list allocator.
Definition at line 46 of file list_alloc.
|
inline |
Allocate a memory block.
| size | Size of the memory block. |
| align | Alignment constraint. |
| lower | Lower bound of the physical region the memory block should be allocated from. |
| upper | Upper bound of the physical region the memory block should be allocated from, value is inclusive. |
Definition at line 389 of file list_alloc.
|
inline |
Allocate a memory block of min <= size <= max.
| min | Minimal size to allocate (in bytes). | |
| [in,out] | max | Maximum size to allocate (in bytes). The actual allocated size is returned here. |
| align | Alignment constraint. | |
| granularity | Granularity to use for the allocation (power of 2). | |
| lower | Lower bound of the physical region the memory block should be allocated from. | |
| upper | Upper bound of the physical region the memory block should be allocated from, value is inclusive. |
Definition at line 269 of file list_alloc.
References l4_round_size(), and l4_trunc_size().
|
inline |
Get the amount of available memory.
Definition at line 477 of file list_alloc.
|
inline |
Return a free memory block to the allocator.
| block | Pointer to memory block. |
| size | Size of memory block. |
| initial_free | Set to true for putting fresh memory to the allocator. This will enforce alignment on that memory. |
Definition at line 228 of file list_alloc.