lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] Re: [lwip-members] minor pbuf.c changes


From: Leon Woestenberg
Subject: [lwip-devel] Re: [lwip-members] minor pbuf.c changes
Date: Mon, 20 Oct 2003 19:57:04 +0200

Hello all,

> attached is a patch which changes some comments in pbuf.c, makes pool
>
  * For a pbuf chain, this is repeated for each pbuf in the chain, until
  * a reference count > 1 is encountered, or the end of the chain is
  * reached.
  *

Although the initial documentation for pbuf_free() was indeed incorrect
this is not quite correct either.

When a reference count > 1 is encountered, it is decremented, and the
rest of the chain is not freed.

I propose to change in into this:

  * For a pbuf chain, this is repeated up to the pbuf which has a non-zero
  * reference count after decrementing. (This might be the whole chain.)

> pbuf flags be inited only once and removes some checks for NULL params
> where those trigger asserts too. I am not sure baout this last change so
> I'd like some opinions : generally either asserts or clean handling is
> needed but in this case I don't know which is preffered.
>

The assert is there to find programmer bugs during test phase. The NULL
check is there to be more robust (for programming errors) after the test
phase
has ended.

Of course, this is application specific.

> Also what is the status of pbuf_ref_chain the last ifdef 0-d out funtion
> in the file?
>
Deprecated if you ask me.

We can safely remove it.

Regards,

Leon.





reply via email to

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