/[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.37 by likewise, Tue Apr 1 12:17:55 2003 UTC revision 1.38 by likewise, Tue Apr 1 12:28:45 2003 UTC
# Line 597  pbuf_free(struct pbuf *p) Line 597  pbuf_free(struct pbuf *p)
597    
598    PERF_START;    PERF_START;
599    
600    LWIP_ASSERT("pbuf_free: sane flags", p->flags == PBUF_FLAG_POOL ||    LWIP_ASSERT("pbuf_free: sane flags",
601      p->flags == PBUF_FLAG_ROM ||      p->flags == PBUF_FLAG_RAM || p->flags == PBUF_FLAG_ROM ||
602      p->flags == PBUF_FLAG_RAM ||      p->flags == PBUF_FLAG_REF || p->flags == PBUF_FLAG_POOL);
     p->flags == PBUF_FLAG_REF );  
603    
   q = p;  
604    count = 0;    count = 0;
605    /* Since decrementing ref cannot be guaranteed to be a single machine operation    /* Since decrementing ref cannot be guaranteed to be a single machine operation
606     * 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.
# Line 612  pbuf_free(struct pbuf *p) Line 610  pbuf_free(struct pbuf *p)
610     * obtain a zero reference count */     * obtain a zero reference count */
611    while (p != NULL) {    while (p != NULL) {
612      /* all pbufs in a chain are referenced at least once */      /* all pbufs in a chain are referenced at least once */
613      LWIP_ASSERT("pbuf_free: q->ref > 0", q->ref > 0);      LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
614      p->ref--;      p->ref--;
615      /* this pbuf is no longer referenced to? */      /* this pbuf is no longer referenced to? */
616      if (p->ref == 0)      if (p->ref == 0)
# Line 679  pbuf_ref(struct pbuf *p) Line 677  pbuf_ref(struct pbuf *p)
677  {  {
678    SYS_ARCH_DECL_PROTECT(old_level);    SYS_ARCH_DECL_PROTECT(old_level);
679    /* pbuf given? */      /* pbuf given? */  
680    if(p != NULL) {    if (p != NULL) {
681      SYS_ARCH_PROTECT(old_level);      SYS_ARCH_PROTECT(old_level);
682      ++(p->ref);      ++(p->ref);
683      SYS_ARCH_UNPROTECT(old_level);      SYS_ARCH_UNPROTECT(old_level);

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

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