BeRTOS
Defines
pool.h File Reference
#include <cfg/macros.h>
#include <struct/list.h>

Go to the source code of this file.

Defines

#define EXTERN_POOL(name)   extern List name
 Extern pool declaration.
#define DECLARE_POOL(name, type, num)   DECLARE_POOL_WITH_STORAGE(name, type, num, List)
 Helper macro to declare a Pool data type.
#define DECLARE_POOL_STATIC(name, type, num)   DECLARE_POOL_WITH_STORAGE(name, type, num, static List)
 Static Pool declaration.
#define pool_init(name, init_func)   (*(name##_init))(init_func)
 Initialize the pool name, calling init_func on each element.
#define pool_alloc(name)   list_remHead(name)
 Allocate an element from the pool.
#define pool_free(name, elem)   ADDHEAD(name, (Node*)elem)
 Recycle an element into the pool.
#define pool_empty(name)   LIST_EMPTY(name)
 Test if the pool is empty.

Detailed Description

Definition in file pool.h.