lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] MEMP_MEM_MALLOC


From: Giuseppe Modugno
Subject: Re: [lwip-users] MEMP_MEM_MALLOC
Date: Tue, 27 Feb 2018 13:48:04 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Il 27/02/2018 13:08, Giuseppe Modugno ha scritto:

I'm thinking if it's better to set MEMP_MEM_MALLOC or not in my application. I'm working with MEMP_MEM_MALLOC=1 (I started from an example) and it works. However I'm not sure it's the best choice for me.

So what are the arguments for and against MEMP_MEM_MALLOC?

This is what I have understood:

  • lwip *always* uses pools for some dynamic data (for example UDP PCBs and timeouts);
  • pools have a *fixed* number for maximum allocated elements (for example, MEMP_NUM_SYS_TIMEOUT for timeouts);
  • (MEMP_MEM_MALLOC=0): all the elements of the pools are statically allocated (so they're not in the heap);
In my case, MEMP_MEM_MALLOC=0 needs 31000 bytes in RAM, while MEMP_MEM_MALLOC=1 needs only 13172 bytes.


reply via email to

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