lwIP 2.1.1 Lightweight IP stack

Macros | Enumerations | Functions
memp.h File Reference
`#include "lwip/opt.h"`
`#include "lwip/priv/memp_std.h"`
`#include "lwip/priv/memp_priv.h"`
`#include "lwip/stats.h"`

## Macros
#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

## Functions
void | memp_init (void)
void * | memp_malloc (memp_t type)
void | memp_free (memp_t type, void *mem)

## Detailed Description

Memory pool API

lwIP internal memory pools (do not use in application code) This file is deliberately included multiple times: once with empty definition of LWIP_MEMPOOL() to handle all includes and multiple times to build up various lists of mem pools.

## Enumeration Type Documentation

## ◆ memp_t

enum memp_t

Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end

## Function Documentation

## ◆ memp_free()

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

Put an element back into its pool.

Parameters

  type | the pool where to put mem
  mem | the memp element to free

## ◆ memp_init()

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.

## ◆ memp_malloc()

void* memp_malloc | ( | memp_t | type | ) |

Get an element from a specific pool.

Parameters

  type | the pool to get an element from

Returns
  a pointer to the allocated memory or a NULL pointer on error