[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [task #6863] Create option to use different size pools (usi
From: |
Simon Goldschmidt |
Subject: |
[lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap |
Date: |
Mon, 11 Jun 2007 16:21:45 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4 |
Follow-up Comment #1, task #6863 (project lwip):
I've finally managed to create a mem.c implementation that uses memp pools.
The challenge I faced (am still facing in fact) is the following:
Initially, I wanted to have configuration options like this:
#define MEM_USE_POOLS 1
#define MEM_POOL_COUNT 3
#define MEM_POOL_SIZE 64,500,1500
#define MEM_POOL_NUM 100,20,10
But does anyone know how I then can calculate the size of each pool using the
preprocessor??? To create the memp_memory, I would have to calculate 63*100,
500*20, 1500*10 using the preprocessor. Since I really don't know how to do
that, I changed the defines to this:
#define MEM_USE_POOLS 1
#define MEM_POOL_COUNT 3
#define MEM_POOL_SIZE_1 64
#define MEM_POOL_NUM_1 100
#define MEM_POOL_SIZE_2 500
#define MEM_POOL_NUM_2 20
#define MEM_POOL_SIZE_3 1500
#define MEM_POOL_NUM_3 10
By doing it that way, I get many lines like '#if MEM_POOL_COUNT > X' in the
memp code.
That's very bad code but it's still working and way faster than the normal
heap.
I'll check it in (as default off -> using the normal heap) these days if
noone comes up with a better solution!
(file #13016)
_______________________________________________________
Additional Item Attachment:
File name: mem_pools.patch Size:7 KB
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/task/?6863>
_______________________________________________
Nachricht geschickt von/durch Savannah
http://savannah.nongnu.org/
- [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap,
Simon Goldschmidt <=
- [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap, Frédéric Bernon, 2007/06/11
- [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap, Simon Goldschmidt, 2007/06/11
- [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap, Simon Goldschmidt, 2007/06/11
- [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap, Frédéric Bernon, 2007/06/12
- [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap, Kieran Mansley, 2007/06/12
- [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap, Simon Goldschmidt, 2007/06/13
- [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap, Frédéric Bernon, 2007/06/13
- [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap, Simon Goldschmidt, 2007/06/13
- [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap, Frédéric Bernon, 2007/06/13
- [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap, Simon Goldschmidt, 2007/06/21