FD.io VPP
v20.05-21-gb1500e9ff
Vector Packet Processing
|
Simple first-fit virtual space allocator. More...
Go to the source code of this file.
Data Structures | |
struct | clib_valloc_chunk_t |
struct | clib_valloc_main_t |
Macros | |
#define | CLIB_VALLOC_BUSY (1<<0) |
chunk is in use More... | |
#define | CLIB_VALLOC_INITIALIZED (1<<0) |
object has been initialized More... | |
Functions | |
void | clib_valloc_init (clib_valloc_main_t *vam, clib_valloc_chunk_t *template, int need_lock) |
Initialize a virtual memory allocation arena. More... | |
void | clib_valloc_add_chunk (clib_valloc_main_t *vam, clib_valloc_chunk_t *template) |
Add a chunk of memory to a virtual allocation arena. More... | |
uword | clib_valloc_free (clib_valloc_main_t *vam, uword baseva) |
Free virtual space. More... | |
uword | clib_valloc_alloc (clib_valloc_main_t *vam, uword size, int os_out_of_memory_on_failure) |
Allocate virtual space. More... | |
Variables | |
format_function_t | format_valloc |
Simple first-fit virtual space allocator.
Definition in file valloc.h.
#define CLIB_VALLOC_INITIALIZED (1<<0) |
void clib_valloc_add_chunk | ( | clib_valloc_main_t * | vam, |
clib_valloc_chunk_t * | template | ||
) |
Add a chunk of memory to a virtual allocation arena.
vam | - clib_valloc_main_t * pointer to the allocation arena |
template | - clib_valloc_chunk_t * pointer to a template chunk which describes the virtual address range to add |
Definition at line 33 of file valloc.c.
uword clib_valloc_alloc | ( | clib_valloc_main_t * | vam, |
uword | size, | ||
int | os_out_of_memory_on_failure | ||
) |
Allocate virtual space.
vam | - clib_valloc_main_t * pointer to the allocation arena |
size | - u64 number of bytes to allocate - 1=> panic on allocation failure |
Definition at line 151 of file valloc.c.
uword clib_valloc_free | ( | clib_valloc_main_t * | vam, |
uword | baseva | ||
) |
Free virtual space.
vam | - clib_valloc_main_t * pointer to the allocation arena |
baseva | - uword base virtual address of the returned space |
Definition at line 228 of file valloc.c.
void clib_valloc_init | ( | clib_valloc_main_t * | vam, |
clib_valloc_chunk_t * | template, | ||
int | need_lock | ||
) |
Initialize a virtual memory allocation arena.
vam | - clib_valloc_main_t * pointer to the arena to initialize |
template | - clib_valloc_chunk_t * pointer to a template chunk which describes the initial virtual address range |
Definition at line 129 of file valloc.c.
format_function_t format_valloc |