lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] Installed the new version, since allthechangesandturned


From: Joolz [RSD]
Subject: RE: [lwip-users] Installed the new version, since allthechangesandturned on the ASSERT debug
Date: Tue, 20 Mar 2007 16:13:50 -0000

 

-----Original Message-----
From: Kieran Mansley [mailto:address@hidden 
Sent: 20 March 2007 16:12
To: Mailing list for lwIP users
Subject: RE: [lwip-users] Installed the new version, since
allthechangesandturned on the ASSERT debug

On Tue, 2007-03-20 at 15:45 +0000, Joolz [RSD] wrote:
> Do I need to free the data, I thought that would be done by the 
> udp_send

>From doc/rawapi.txt:
>>- err_t udp_send(struct udp_pcb *pcb, struct pbuf *p)
>> Sends the pbuf p. The pbuf is not deallocated.

>>udp_send() can't free it for you as it has no idea how you allocated
it.
>>For example, the pvMalloc() call above was used to create the payload
area, but lwIP has no idea how to do the opposite of that to release the
memory 
>>you've used.
>>

What I meant was the header buffer it creates, not my data allocation.

When I send the first packet I see that data->payload now has a pointer
and data->len is now 44, overall length is (7*188)+44, I would have
thought that this would be back to 0 and 7*188 after the send.

>>One other thing that concerns me about the above is that it suggests
that you are assuming that by the time the udp_send() call returns,
there will be no 
>>further need to access the memory you passed in.
>>Depending on your hardware, and the driver that sits underneath lwIP,
this might not be the case.  lwIP has finished with it, but the driver
might not have got 
>>it onto the wire yet.  However, there's no visible way to find out
when it is safe to free the memory for UDP.  For TCP we have the "sent"
callback.  So not a 
>>lot you can do about that, but worth being careful and making sure
it's not a problem for you.
>>
>>Kieran

I am pretty sure that the data will be available as I said before the
buffer is 512K and for this to wrap around before a packet is sent
should not happen.




  



_______________________________________________
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]