lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Re: lwip-users Digest, Vol 87, Issue 24


From: address@hidden
Subject: Re: [lwip-users] Re: lwip-users Digest, Vol 87, Issue 24
Date: Mon, 22 Nov 2010 20:27:01 +0100
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

Chen,

lwIP targets embedded systems. The lwIP-internal heap (which can be replaced to use any other heap or the C-library's malloc/free functions) uses MEM_SIZE to define a region of memory that is reserved for the heap when creating the embedded system's memory image. Making this configurable at runtime would mean that all other variables in memory might move. This is not possible, since the linker has to know such sizes in advance.

However, I guess you could reserve the maximum (worst-case) amount for MEM_SIZE and use mem_malloc() to allocate a big memory region from that heap which you can then use for something else if you know that you don't need the full heap for lwIP.

Other than that, as Kieran already said, lwIP provides many other defines to tweak RAM usage, so if you are concerned about memory usage, MEM_SIZE is definitively not the only thing to look at!

Simon


Chen wrote:
I was thinking to change it according to the expected load on my bandwidth

At 12:00 PM 11/22/2010, you wrote:
Message: 4
Date: Mon, 22 Nov 2010 14:28:01 +0000
From: Kieran Mansley <address@hidden>
Subject: Re: [lwip-users] Changing tx buffer MEM_SIZE?
To: Mailing list for lwIP users <address@hidden>
Message-ID: <address@hidden>
Content-Type: text/plain

On Mon, 2010-11-22 at 09:23 -0500, Chen wrote:
>
> /* MEM_SIZE: the size of the heap memory. If the application will send
> a lot of data that needs to be copied, this should be set high. */
> #define MEM_SIZE                3 * 1024
>
> How can I change MEM_SIZE on the fly according to different
> configuration?

You can't.  It's a compile time constant.

What are you trying to achieve though?  lwIP has a number of different
ways of allocating memory (static heap, pools, malloc) that are suited
to different environments.

Kieran 




------------------------------

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

End of lwip-users Digest, Vol 87, Issue 24
******************************************
_______________________________________________ lwip-users mailing list address@hidden http://lists.nongnu.org/mailman/listinfo/lwip-users


reply via email to

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