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) |
Allocate a memory block. | |
void * | alloc_max (unsigned long min, unsigned long *max, unsigned long align, unsigned granularity) |
Allocate a memory block of min <= size <= max . | |
unsigned long | avail () |
Get the amount of available memory. | |
Standard list-based allocator.
Definition at line 31 of file list_alloc.
|
inline |
Initializes an empty list allocator.
Definition at line 56 of file list_alloc.
|
inline |
Allocate a memory block.
size | Size of the memory block. |
align | Alignment constraint. |
size
<= ~0UL - 32
. Definition at line 363 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). |
min
<= ~0UL - 32
. max
. Definition at line 266 of file list_alloc.
References l4_round_size(), l4_trunc_size(), cxx::max(), and cxx::min().
|
inline |
Get the amount of available memory.
Definition at line 434 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. |
block
must not be NULL. 2 * sizeof(void *)
<= size
<= ~0UL - 32
. Definition at line 227 of file list_alloc.