|
From: | address@hidden |
Subject: | Re: [lwip-users] TCP_WRITE [Raw] |
Date: | Mon, 09 Nov 2009 17:22:23 +0100 |
User-agent: | Thunderbird 2.0.0.23 (Macintosh/20090812) |
Bill Auerbach wrote:
It's a bit wasteful, but could he pre-allocate what tcp_write would do when copy is enabled, if it passes, free the memory and then call tcp_write. If the pre-allocate fails, it would have in tcp_write also.
So why bother with trying? tcp_write failing will tell you the same.
Enqueueing pre-allocated pbufs (which essentially is what you suggest) is a thing I'd like to have in the future, but it's not supported right now. Besides, it would not solve this problem as we might be running out of other resources (e.g. struct tcp_seg) as well.Is there a way to allocate a pbuf with a mem_malloced payload that the stack knows to mem_free when it's done? If so, he could mem_malloc and copy himself and let the stack free it up.
Simon
[Prev in Thread] | Current Thread | [Next in Thread] |