memp.h

Memory pool API.

Defines

LWIP_MEMPOOL(name, num, size, desc)
LWIP_MEMPOOL(name, num, size, desc)
LWIP_MEMPOOL_PROTOTYPE(name)

Declare prototype for private memory pool if it is used in multiple files.

LWIP_MEMPOOL_DECLARE(name, num, size, desc)

Declare a private memory pool Private mempools example: .h: only when pool is used in multiple .c files: LWIP_MEMPOOL_PROTOTYPE(my_private_pool); .c:

To relocate a pool, declare it as extern in cc.h. Example for GCC: extern u8_t __attribute__((section(“.onchip_mem”))) memp_memory_my_private_pool_base[];

LWIP_MEMPOOL_INIT(name)

Initialize a private memory pool.

LWIP_MEMPOOL_ALLOC(name)

Allocate from a private memory pool.

LWIP_MEMPOOL_FREE(name, x)

Free element from a private memory pool.

Enums

enum memp_t

Create the list of all memory pools managed by memp.

MEMP_MAX represents a NULL pool at the end

Values:

enumerator MEMP_MAX

Functions

void *memp_malloc(memp_t type)
void memp_free(memp_t type, void *mem)

Variables

const struct memp_desc *const memp_pools[MEMP_MAX]