uc-sdk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
memp.h File Reference
#include "lwip/opt.h"
#include "lwip/memp_std.h"

Go to the source code of this file.

Macros

#define LWIP_MEMPOOL(name, num, size, desc)   MEMP_##name,
 

Enumerations

enum  memp_t { MEMP_MAX }
 

Functions

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

Macro Definition Documentation

#define LWIP_MEMPOOL (   name,
  num,
  size,
  desc 
)    MEMP_##name,

Definition at line 44 of file memp.h.

Enumeration Type Documentation

enum memp_t
Enumerator
MEMP_MAX 

Definition at line 43 of file memp.h.

Function Documentation

void memp_free ( memp_t  type,
void *  mem 
)

Put an element back into its pool.

Parameters
typethe pool where to put mem
memthe memp element to free

Definition at line 434 of file memp.c.

void memp_init ( void  )

Initialize this module.

Carves out memp_memory into linked lists for each pool-type.

Definition at line 337 of file memp.c.

void* memp_malloc ( memp_t  type)

Get an element from a specific pool.

Parameters
typethe pool to get an element from

the debug version has two more parameters:

Parameters
filefile name calling this function
linenumber of line where this function is called
Returns
a pointer to the allocated memory or a NULL pointer on error

Definition at line 389 of file memp.c.