The Pedigree Project
0.1
|
Go to the source code of this file.
Macros | |
#define | LWIP_MEMPOOL(name, num, size, desc) |
#define | LWIP_MEMPOOL(name, num, size, desc) MEMP_##name, |
#define | LWIP_MEMPOOL_PROTOTYPE(name) extern const struct memp_desc memp_ ## name |
#define | LWIP_MEMPOOL_DECLARE(name, num, size, desc) |
#define | LWIP_MEMPOOL_INIT(name) memp_init_pool(&memp_ ## name) |
#define | LWIP_MEMPOOL_ALLOC(name) memp_malloc_pool(&memp_ ## name) |
#define | LWIP_MEMPOOL_FREE(name, x) memp_free_pool(&memp_ ## name, (x)) |
Enumerations | |
enum | memp_t { MEMP_MAX } |
Functions | |
void | memp_init (void) |
void * | memp_malloc (memp_t type) |
void | memp_free (memp_t type, void *mem) |
Variables | |
const struct memp_desc *const | memp_pools [MEMP_MAX] |
Memory pool API
Definition in file memp.h.
enum memp_t |
void memp_free | ( | memp_t | type, |
void * | mem | ||
) |
Put an element back into its pool.
type | the pool where to put mem |
mem | the memp element to free |
Definition at line 488 of file memp.c.
References memp_desc::tab.
Referenced by pbuf_free(), tcpip_callback_with_block(), tcpip_callbackmsg_delete(), and tcpip_inpkt().
void memp_init | ( | void | ) |
Initializes lwIP built-in pools. Related functions: memp_malloc, memp_free
Carves out memp_memory into linked lists for each pool-type.
Definition at line 290 of file memp.c.
References LWIP_DBG_LEVEL_SERIOUS, LWIP_DEBUGF, mem_malloc(), MEMP_DEBUG, memp_init_pool(), memp_desc::size, SYS_ARCH_DECL_PROTECT, and memp_desc::tab.
Referenced by lwip_init().
void* memp_malloc | ( | memp_t | type | ) |
Get an element from a specific pool.
type | the pool to get an element from |
Definition at line 404 of file memp.c.
References LWIP_UNUSED_ARG, mem_free(), SYS_ARCH_DECL_PROTECT, and memp_desc::tab.
Referenced by pbuf_alloc(), tcpip_callback_with_block(), tcpip_callbackmsg_new(), and tcpip_inpkt().