Mistake on this page?
Report an issue in GitHub or email us
Macros | Enumerations
memp.h File Reference

Memory pool API. More...

#include "lwip/opt.h"
#include "lwip/priv/memp_std.h"
#include "lwip/priv/memp_priv.h"
#include "lwip/stats.h"

Go to the source code of this file.

Macros

#define LWIP_MEMPOOL_PROTOTYPE(name)   extern const struct memp_desc memp_ ## name
 Declare prototype for private memory pool if it is used in multiple files. More...
 
#define 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: More...
 
#define LWIP_MEMPOOL_INIT(name)    memp_init_pool(&memp_ ## name)
 Initialize a private memory pool. More...
 
#define LWIP_MEMPOOL_ALLOC(name)    memp_malloc_pool(&memp_ ## name)
 Allocate from a private memory pool. More...
 
#define LWIP_MEMPOOL_FREE(name, x)   memp_free_pool(&memp_ ## name, (x))
 Free element from a private memory pool. More...
 

Enumerations

Detailed Description

Memory pool API.

Definition in file memp.h.

Macro Definition Documentation

#define LWIP_MEMPOOL_ALLOC (   name)    memp_malloc_pool(&memp_ ## name)

Allocate from a private memory pool.

Definition at line 122 of file memp.h.

#define LWIP_MEMPOOL_DECLARE (   name,
  num,
  size,
  desc 
)
Value:
LWIP_DECLARE_MEMORY_ALIGNED(memp_memory_ ## name ## _base, ((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))); \
\
LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) \
\
static struct memp *memp_tab_ ## name; \
\
const struct memp_desc memp_ ## name = { \
DECLARE_LWIP_MEMPOOL_DESC(desc) \
LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) \
LWIP_MEM_ALIGN_SIZE(size), \
(num), \
memp_memory_ ## name ## _base, \
&memp_tab_ ## name \
};
char name[2]
descriptive abbreviation
Definition: netif.h:348
u8_t num
number of this interface.
Definition: netif.h:351
u16_t num
Number of elements.
Definition: memp_priv.h:123
#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size)
Allocates a memory buffer of specified size that is of sufficient size to align its start address usi...
Definition: arch.h:271
Definition: memp_priv.h:69
u16_t size
Element size.
Definition: memp_priv.h:119
Memory pool descriptor.
Definition: memp_priv.h:108

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[];

Definition at line 95 of file memp.h.

#define LWIP_MEMPOOL_FREE (   name,
 
)    memp_free_pool(&memp_ ## name, (x))

Free element from a private memory pool.

Definition at line 127 of file memp.h.

#define LWIP_MEMPOOL_INIT (   name)    memp_init_pool(&memp_ ## name)

Initialize a private memory pool.

Definition at line 117 of file memp.h.

#define LWIP_MEMPOOL_PROTOTYPE (   name)    extern const struct memp_desc memp_ ## name

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

Definition at line 67 of file memp.h.

Enumeration Type Documentation

enum memp_t

Create the list of all memory pools managed by memp.

MEMP_MAX represents a NULL pool at the end

Definition at line 52 of file memp.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.