From 22f51f953b7503b84e9f50134368e9464843f73a Mon Sep 17 00:00:00 2001 From: goldsimon Date: Mon, 3 Dec 2007 18:01:28 +0000 Subject: [PATCH] Added short comment in file description about how to handle MEM_USE_POOLS / MEM_LIBC_MALLOC --- src/core/mem.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/core/mem.c b/src/core/mem.c index e5c1ca4b..61139e6e 100644 --- a/src/core/mem.c +++ b/src/core/mem.c @@ -2,6 +2,22 @@ * @file * Dynamic memory manager * + * This is a lightweight replacement for the standard C library malloc(). + * + * If you want to use the standard C library malloc() instead, define + * MEM_LIBC_MALLOC to 1 in your lwipopts.h + * + * To let mem_malloc() use pools (prevents fragmentation and is much faster than + * a heap but might waste some memory), define MEM_USE_POOLS to 1, define + * MEM_USE_CUSTOM_POOLS to 1 and create a file "lwippools.h" that includes a list + * of pools like the this (more pools can be added between _START and _END): + * + * /* Define three pools with sizes 256, 512, and 1512 bytes + * LWIP_MALLOC_MEMPOOL_START + * LWIP_MALLOC_MEMPOOL(20, 256) + * LWIP_MALLOC_MEMPOOL(10, 512) + * LWIP_MALLOC_MEMPOOL(5, 1512) + * LWIP_MALLOC_MEMPOOL_END */ /*