ReactOS 0.4.16-dev-297-gc569aee
Memory pools
Collaboration diagram for Memory pools:

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))
 

Detailed Description

Custom memory pools

Macro Definition Documentation

◆ LWIP_MEMPOOL_ALLOC

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

Allocate from a private memory pool

Definition at line 122 of file memp.h.

◆ LWIP_MEMPOOL_DECLARE

#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 \
};
GLsizeiptr size
Definition: glext.h:5919
GLuint GLuint num
Definition: glext.h:9618
#define LWIP_DECLARE_MEMORY_ALIGNED(variable_name, size)
Definition: arch.h:271
#define MEMP_ALIGN_SIZE(x)
Definition: memp_priv.h:64
#define MEMP_SIZE
Definition: memp_priv.h:63
static const WCHAR desc[]
Definition: protectdata.c:36
Definition: memp_priv.h:69
Definition: name.c:39

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.

◆ LWIP_MEMPOOL_FREE

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

Free element from a private memory pool

Definition at line 127 of file memp.h.

◆ LWIP_MEMPOOL_INIT

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

Initialize a private memory pool

Definition at line 117 of file memp.h.

◆ LWIP_MEMPOOL_PROTOTYPE

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