|
UbixOS
2.0
|
#include "net/opt.h"#include "net/memp.h"#include "net/sys.h"#include "net/stats.h"#include <string.h>#include "net/pbuf.h"#include "net/raw.h"#include "net/udp.h"#include "net/tcp.h"#include "net/priv/tcp_priv.h"#include "net/ip4_frag.h"#include "net/netbuf.h"#include "net/api.h"#include "net/priv/tcpip_priv.h"#include "net/priv/api_msg.h"#include "net/sockets.h"#include "net/netifapi.h"#include "net/etharp.h"#include "net/igmp.h"#include "net/timeouts.h"#include "netif/ppp/ppp_opts.h"#include "net/netdb.h"#include "net/dns.h"#include "net/priv/nd6_priv.h"#include "net/ip6_frag.h"#include "net/mld6.h"#include "net/priv/memp_std.h"
Go to the source code of this file.
Macros | |
| #define | LWIP_MEMPOOL(name, num, size, desc) LWIP_MEMPOOL_DECLARE(name,num,size,desc) |
| #define | LWIP_MEMPOOL(name, num, size, desc) &memp_ ## name, |
Functions | |
| void | memp_free (memp_t type, void *mem) |
| void | memp_free_pool (const struct memp_desc *desc, void *mem) |
| void | memp_init (void) |
| void | memp_init_pool (const struct memp_desc *desc) |
| void * | memp_malloc (memp_t type) |
| void * | memp_malloc_pool (const struct memp_desc *desc) |
Variables | |
| const struct memp_desc *const | memp_pools [MEMP_MAX] |
Dynamic pool memory manager
lwIP has dedicated pools for many structures (netconn, protocol control blocks, packet buffers, ...). All these pools are managed here.
Definition in file memp.c.
| #define LWIP_MEMPOOL | ( | name, | |
| num, | |||
| size, | |||
| desc | |||
| ) | LWIP_MEMPOOL_DECLARE(name,num,size,desc) |
| 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 469 of file memp.c.
References LWIP_ERROR, MEMP_MAX, memp_pools, NULL, and memp_desc::tab.
Referenced by pbuf_free(), and tcpip_callbackmsg_delete().
Put a custom pool element back into its pool.
| desc | the pool where to put mem |
| mem | the memp element to free |
Definition at line 452 of file memp.c.
References LWIP_ASSERT, and NULL.
| 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 271 of file memp.c.
References LWIP_ARRAYSIZE, memp_init_pool(), and memp_pools.
Referenced by lwip_init().

Initialize custom memory pool. Related functions: memp_malloc_pool, memp_free_pool
| desc | pool to initialize |
Definition at line 230 of file memp.c.
References memp_desc::base, LWIP_MEM_ALIGN, LWIP_UNUSED_ARG, MEMP_OVERFLOW_CHECK, MEMP_SIZE, memp::next, NULL, memp_desc::num, memp_desc::size, and memp_desc::tab.
Referenced by memp_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 385 of file memp.c.
References LWIP_ERROR, MEMP_MAX, and NULL.
Referenced by pbuf_alloc(), and tcpip_callbackmsg_new().
Get an element from a custom pool.
| desc | the pool to get an element from |
Definition at line 359 of file memp.c.
References LWIP_ASSERT, and NULL.
Definition at line 81 of file memp.c.
Referenced by memp_free(), and memp_init().