On 17.09.2018 22:20, Andy Pont wrote:
That macro allocates pools of X elements with Y bytes each.
It allocates (14 * 75) + (6 * 225) + (1 * 525) + (3 * 1540) bytes
plus a little offset for administration, so roughly 7,5 kB.
Is that memory being allocated by the linker in either the .data or
.bss sections
Yes. Just follow the defines:
LWIP_MALLOC_MEMPOOL() -> LWIP_MEMPOOL() -> LWIP_MEMPOOL_DECLARE() ->
memp.h lint 95 (git head) instantiates the memory via
LWIP_DECLARE_MEMORY_ALIGNED()
Ok, this isn't fun to read from the code, but that's the price for
making it configurable ;-)
or is it pulled from the heap using malloc()?
lwIP does *not* use malloc() unless you tell it to!
They also seem like some really weird combinations of numbers and
appear to be one of those things that never got documented anywhere.
Any guesses?
No. Well, smallest packets are 60 bytes + 16 bytes for struct pbuf and
largest packets are ~1514 bytes + 16 bytes for struct pbuf. Add
alignment to this and the smallest and largest pool might make sense...
Simon
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lwip-users