forked from Imagelibrary/lwip
fixed bug #21433 (Calling mem_free/pbuf_free from interrupt context isn't safe): set LWIP_USE_HEAP_FROM_INTERRUPT to 1 in lwipopts.h or use tcpip_callback_nonblocking(pbuf_free_int, p)/ tcpip_callback_nonblocking(mem_free, m) to free pbufs or heap memory from interrupt context
This commit is contained in:
@@ -518,4 +518,17 @@ tcpip_init(void (* initfunc)(void *), void *arg)
|
||||
sys_thread_new(TCPIP_THREAD_NAME, tcpip_thread, NULL, TCPIP_THREAD_STACKSIZE, TCPIP_THREAD_PRIO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A simple wrapper function that allows you to free a pbuf using one of the
|
||||
* tcpip_callback functions.
|
||||
*
|
||||
* @param p The pbuf (chain) to be dereferenced.
|
||||
*/
|
||||
void
|
||||
pbuf_free_int(struct pbuf *p)
|
||||
{
|
||||
pbuf_free(p);
|
||||
}
|
||||
|
||||
#endif /* !NO_SYS */
|
||||
|
||||
Reference in New Issue
Block a user