lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] where could I find the definition of MEMP_PBUF_POOL use


From: address@hidden
Subject: Re: [lwip-users] where could I find the definition of MEMP_PBUF_POOL used in pbuf.c?
Date: Fri, 11 Apr 2008 20:57:52 +0200
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)

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 !






reply via email to

[Prev in Thread] Current Thread [Next in Thread]