Hi,

I have three questions regarding the memory definitions in lwipopts.h based on 
lwIPv1.3.0. I wonder if some one can help me.

(1) In current memory options defined as below.
//#define MEM_LIBC_MALLOC                 0
#define MEM_ALIGNMENT                   4           // default is 1
#define MEM_SIZE                        (18 * 1024)  // default is 1600, was 
16KIntDefaultHandler
//#define MEMP_OVERFLOW_CHECK             0
#define MEMP_SANITY_CHECK               1
//#define MEM_USE_POOLS                   0
//#define MEMP_USE_CUSTOM_POOLS           0
Q1: Can I reduce the MEM_SIZE TO (12 * 1024)? Is there any risk there?

(2)   If I defined MEM_USE_POOLS  1 and MEMP_USE_CUSTOM_POOLS  1,
Q2: Can I undifine the MEM_SIZE? Since MEM_SIZE disabled, where is the memory 
allocate for MEM_USE_POOLS and what is size for its using?

(3)   When I defined MEM_USE_POOLS  1 and MEMP_USE_CUSTOM_POOLS  1 and added 
lwippools.h, I tried to compile the system. But I got below compile errors.
#if MEM_USE_POOLS
/* Use a helper type to get the start and end of the user "memory pools" for 
mem_malloc */
typedef enum {
    /* Get the first (via:
       MEMP_POOL_HELPER_START = ((u8_t) 1*MEMP_POOL_A + 0*MEMP_POOL_B + 
0*MEMP_POOL_C + 0) */
    MEMP_POOL_HELPER_FIRST = ((u8_t)
#define LWIP_MEMPOOL(name,num,size,desc)
#define LWIP_MALLOC_MEMPOOL_START 1
#define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0
#define LWIP_MALLOC_MEMPOOL_END
#include "lwip/memp_std.h"
    ) ,  ..\Common\ethernet\lwip-1.3.0\src\include\lwip/memp.h(60): error:  
#29: expected an expression
    /* Get the last (via:
       MEMP_POOL_HELPER_END = ((u8_t) 0 + MEMP_POOL_A*0 + MEMP_POOL_B*0 + 
MEMP_POOL_C*1) */
    MEMP_POOL_HELPER_LAST = ((u8_t)
#define LWIP_MEMPOOL(name,num,size,desc)
#define LWIP_MALLOC_MEMPOOL_START
#define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size *
#define LWIP_MALLOC_MEMPOOL_END 1
#include "lwip/memp_std.h"
    )   ..\Common\ethernet\lwip-1.3.0\src\include\lwip/memp.h(69): error:  #29: 
expected an expression
} memp_pool_helper_t;
Q3: What's wrong with the code or how to fix these compile errors?

Thanks,


Bill Yang
Software Engineer

direct:    +1 801.433.6354
email:   [email protected]<mailto:by...@[email protected]>

Parvus
RUGGED SOLUTIONS for REAL WORLD APPLICATIONS
USA - 3222 S. Washington St. | Salt Lake City, Utah 84115 | Tel. +1 
801.483.1533 | Fax +1 801.483.1523 |
www.parvus.com
A Member of EUROTECH GROUP

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

Reply via email to