547 |
p->flags == PBUF_FLAG_RAM || |
p->flags == PBUF_FLAG_RAM || |
548 |
p->flags == PBUF_FLAG_REF ); |
p->flags == PBUF_FLAG_REF ); |
549 |
|
|
|
LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0); |
|
550 |
|
|
551 |
/* Since decrementing ref cannot be guarranteed to be a single machine operation |
/* Since decrementing ref cannot be guarranteed to be a single machine operation |
552 |
we must protect it. Also, the later test of ref must be protected. |
we must protect it. Also, the later test of ref must be protected. |
553 |
*/ |
*/ |
554 |
SYS_ARCH_PROTECT(old_level); |
SYS_ARCH_PROTECT(old_level); |
555 |
/* Decrement reference count. */ |
/* Decrement reference count. */ |
556 |
p->ref--; |
for (q = p; q != NULL; q = q->next) { |
557 |
|
LWIP_ASSERT("pbuf_free: q->ref == 0", q->ref > 0); |
558 |
|
q->ref--; |
559 |
|
} |
560 |
|
|
561 |
/*q = NULL; DJH: Unnecessary statement*/ |
/*q = NULL; DJH: Unnecessary statement*/ |
562 |
/* If reference count == 0, actually deallocate pbuf. */ |
/* If reference count == 0, actually deallocate pbuf. */ |