lwip-devel
[Top][All Lists]
Advanced

[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: Kieran Mansley
Subject: [lwip-devel] [task #6863] Create option to use different size pools (using memp) instead of heap
Date: Tue, 12 Jun 2007 15:34:56 +0000
User-agent: Opera/9.21 (X11; Linux i686; U; en)

Follow-up Comment #5, task #6863 (project lwip):

The problems you describe in comment#1 are indeed ugly!  I'd rather see
something more elegant if possible, although don't have any preprocessor
magic off the top of my head.  Would doing something like this work better:

#define MEM_POOL_COUNT 3
#define MEM_POOL_SIZES { 64,500,1500 }

struct mem_pool_size {
 int sizes[MEM_POOL_COUNT];
}

struct mem_pool_sizes pool_size = { MEM_POOL_SIZES };

for (i = 0; i < MEM_POOL_COUNT; i++) {
  printf("Pool %d is size %d\n", i, pool_size.sizes[i]);
}

Note, the above is just pseudo-code to illustrate an idea.  You might not
need the struct mem_pool_size; i.e. just use an array, and statically
initialise it using the #defined value. 

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?6863>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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