UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor jeeva91
Visitor
127 Views
Registered: ‎02-12-2019

raw lwip memory management zynq

Hi,

I am trying to understand how raw/lwip handles memory. Can someone help me understand how and where memory is allocated for

1.  The struct pcb in the function tcp_new_ip_type()

2. And the struct pbuf passed to the recv_callback()

Thanks,

jeeva

 

Tags (3)
0 Kudos
1 Reply
Moderator
Moderator
43 Views
Registered: ‎10-06-2016

Re: raw lwip memory management zynq

Hi @jeeva91 

I think this cuestion could be more suitable to be asked in the Lwip development support channels, but anyway here my quick analysis of the sources.

The tcp_new_ip_type function allocates memory using tcp_alloc function, that at the end of the day uses the memory allocation functions provided in the lwip core code as alternative to C library standard malloc. As you can see in the mem.c file, the allocated memory is just taken from the heap, and you can configure lwip to use pool mechanisms.

It's bit more complicated to check the second one but my understanding is that again all the TCP buffers are allocated by the LwIP core using the memory allocation routines, hence using the heap.

Regards


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos