Loading...
Searching...
No Matches
list_alloc.h
Go to the documentation of this file.
/*
* (c) 2003-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
* Frank Mehnert <fm3@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#ifndef L4UTIL_L4LA_H
#define L4UTIL_L4LA_H
#include <l4/sys/l4int.h>
#include <l4/sys/compiler.h>
typedef struct l4la_free_t_s
{
struct l4la_free_t_s *next;
l4_size_t size;
} l4la_free_t;
#define L4LA_INITIALIZER { 0 }
L4_BEGIN_DECLS
L4_CV void l4la_free(l4la_free_t **first, void *block, l4_size_t size);
L4_CV void* l4la_alloc(l4la_free_t **first, l4_size_t size, unsigned align);
L4_CV void l4la_dump(l4la_free_t **first);
L4_CV void l4la_init(l4la_free_t **first);
L4_CV l4_size_t l4la_avail(l4la_free_t **first);
L4_END_DECLS
#endif
compiler.h
L4 compiler related defines.
l4_size_t
unsigned int l4_size_t
Unsigned size type.
Definition l4int.h:24
L4_CV
#define L4_CV
Define calling convention.
Definition linkage.h:33
L4_BEGIN_DECLS
#define L4_BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:165
L4_END_DECLS
#define L4_END_DECLS
End section with C types and functions.
Definition compiler.h:166
l4int.h
Fixed sized integer types, generic version.
l4la_dump
void l4la_dump(l4la_free_t **first)
Show all list members.
l4la_init
void l4la_init(l4la_free_t **first)
Init memory pool.
l4la_alloc
void * l4la_alloc(l4la_free_t **first, l4_size_t size, unsigned align)
Allocate memory from pool.
l4la_free
L4_BEGIN_DECLS void l4la_free(l4la_free_t **first, void *block, l4_size_t size)
Add free memory to memory pool.
l4la_avail
l4_size_t l4la_avail(l4la_free_t **first)
Show available memory in pool.