lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] pbuf_chain followed by pbuf_free


From: Jani Monoses
Subject: [lwip-devel] pbuf_chain followed by pbuf_free
Date: Thu, 30 Oct 2003 10:25:05 +0200

Hi all

I see that almost all (7 of ~10) uses of the form pbuf_chain(p,q) are
followed by pbuf_free(q). It seems to me that having a new function i.e
pbuf_cat(p,q) which would be similar to pbuf_chain with the exception
that it would not increment the refcount of the second pbuf would result
in not needing to call pbuf_free in all these cases. And pbuf_chain
would be pbuf_cat() followed by pbuf_ref(), the equivalent of what it is
now. It seems unnecessary to inc then dec the refcount and taking the
locks for both operations as it is now, and the code would be clearer as
well with pbuf_cat or some other suggestively named function. 

Thoughts?

Jani




reply via email to

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