Hi there,

I think you are mixing 2 different versions of lwIP here: the 3 occurrences of MEMP_PBUF_POOL seem to fit to lwIP v1.3.0 but in the corresponding (and current) memp.h, the typedef enum memp_t is defined like this:

typedef enum {
#define LWIP_MEMPOOL(name,num,size,desc)  MEMP_##name,
#include "lwip/memp_std.h"
 MEMP_MAX
} memp_t;

Some preprocessor magic puts the enum members together, which is why you don't find the real definition of the enum members when searching the code.

Simon


kanprin wrote:
it appears three times in the pbuf.c, but I could not reach its definition ,
where does it defined ? or which num should I define it?

in pbuf.c
line 145: p = memp_malloc(MEMP_PBUF_POOL);
line 175: q = memp_malloc(MEMP_PBUF_POOL);
line 498:  memp_free(MEMP_PBUF_POOL, p);

the MEMP_PBUF_POOL must be memp_t type through memp_malloc();
memp_t is defined in memp.h as

typedef enum {
  MEMP_PBUF,
  MEMP_RAW_PCB,
  MEMP_UDP_PCB,
  MEMP_TCP_PCB,
  MEMP_TCP_PCB_LISTEN,
  MEMP_TCP_SEG,

  MEMP_NETBUF,
  MEMP_NETCONN,
  MEMP_API_MSG,
  MEMP_TCPIP_MSG,

  MEMP_SYS_TIMEOUT,
MEMP_MAX
} memp_t;

but still no MEMP_PBUF_POOL;


regards !




_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to