Make pbuf refcount type an LWIP option and #define it to s8_t (to be able to check for underflow!)

This commit is contained in:
Dirk Ziegelmeier 2017-02-23 15:47:44 +01:00
parent 5c55978f10
commit 2e1b12d09f
2 changed files with 9 additions and 1 deletions

View File

@ -1395,6 +1395,14 @@
#if !defined PBUF_POOL_BUFSIZE || defined __DOXYGEN__
#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_ENCAPSULATION_HLEN+PBUF_LINK_HLEN)
#endif
/**
* LWIP_PBUF_REF_T: Refcount type in pbuf. Must be signed!
* Default width of s8_t can be increased if 127 refs are not enough for you.
*/
#ifndef LWIP_PBUF_REF_T
#define LWIP_PBUF_REF_T s8_t
#endif
/**
* @}
*/

View File

@ -169,7 +169,7 @@ struct pbuf {
* that refer to this pbuf. This can be pointers from an application,
* the stack itself, or pbuf->next pointers from a chain.
*/
u16_t ref;
LWIP_PBUF_REF_T ref;
};