/[lwip]/lwip/src/core/pbuf.c
ViewVC logotype

Diff of /lwip/src/core/pbuf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.17 by davidhaas, Wed Mar 19 22:14:49 2003 UTC revision 1.18 by davidhaas, Fri Mar 21 23:01:20 2003 UTC
# Line 547  pbuf_free(struct pbuf *p) Line 547  pbuf_free(struct pbuf *p)
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. */

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26