lwip-devel
[Top][All Lists]
Advanced

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

RE: [lwip-devel] memp_std.h and MEM_USE_POOLS


From: Grubb, Jared
Subject: RE: [lwip-devel] memp_std.h and MEM_USE_POOLS
Date: Mon, 26 Nov 2007 09:11:24 -0800

Simon,

As far as setting up a set number, you can define as many as you like.
So:

  * #define MEMP_USE_CUSTOM_POOLS 1 to turn on the custom pools.. 

  * Create a "lwippools.h" in the same directory as your "lwipopts.h"
file (doesn't really have to be in the same directory, but it may as
well be). Here is one I put together for an example... did I upload it
to the CVS somewhere?




/* OPTIONAL: Pools to replace heap allocation
 * Optional: Pools can be used instead of the heap for mem_malloc. If
so, these
 * should be defined here, in increasing order according to the pool
element size.
 *
 * LWIP_MALLOC_MEMPOOL(number_elements, element_size)
 */
#if MEM_USE_POOLS
LWIP_MALLOC_MEMPOOL_START
LWIP_MALLOC_MEMPOOL(20, 256)
LWIP_MALLOC_MEMPOOL(10, 512)
LWIP_MALLOC_MEMPOOL(5, 1024)
LWIP_MALLOC_MEMPOOL_END
#endif /* MEM_USE_POOLS */

/* Optional: Your custom pools can go here if you would like to use
lwIP's
 * memory pools for anything else.
 */
LWIP_MEMPOOL(SYS_MBOX, 22, sizeof(struct sys_mbox_struct), "SYS_MBOX")
LWIP_MEMPOOL(SYS_SEM, 12, sizeof(struct sys_sem_struct), "SYS_SEM")






-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
address@hidden
Sent: Sunday, November 25, 2007 02:30
To: lwip-devel
Subject: [lwip-devel] memp_std.h and MEM_USE_POOLS

Hi,

can someone guide me on how to set up number and size of memp_pools with

the 'new' memp_std.h? I've never really used it since that was changed 
and I'd like to know how it's done to write some documentation about it 
(included in memp_std.h or mem.c).

Simon


_______________________________________________
lwip-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-devel




reply via email to

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