215 |
struct pbuf *p, *q, *r; |
struct pbuf *p, *q, *r; |
216 |
u16_t offset; |
u16_t offset; |
217 |
s32_t rem_len; /* remaining length */ |
s32_t rem_len; /* remaining length */ |
218 |
LWIP_DEBUGF(PBUF_DEBUG | DBG_TRACE | 3, ("pbuf_alloc(length=%u)\n", length)); |
LWIP_DEBUGF(PBUF_DEBUG | DBG_TRACE | 3, ("pbuf_alloc(length=%"U16_F")\n", length)); |
219 |
|
|
220 |
/* determine header offset */ |
/* determine header offset */ |
221 |
offset = 0; |
offset = 0; |
339 |
} |
} |
340 |
/* set reference count */ |
/* set reference count */ |
341 |
p->ref = 1; |
p->ref = 1; |
342 |
LWIP_DEBUGF(PBUF_DEBUG | DBG_TRACE | 3, ("pbuf_alloc(length=%u) == %p\n", length, (void *)p)); |
LWIP_DEBUGF(PBUF_DEBUG | DBG_TRACE | 3, ("pbuf_alloc(length=%"U16_F") == %p\n", length, (void *)p)); |
343 |
return p; |
return p; |
344 |
} |
} |
345 |
|
|
503 |
p->len += header_size_increment; |
p->len += header_size_increment; |
504 |
p->tot_len += header_size_increment; |
p->tot_len += header_size_increment; |
505 |
|
|
506 |
LWIP_DEBUGF( PBUF_DEBUG, ("pbuf_header: old %p new %p (%d)\n", |
LWIP_DEBUGF( PBUF_DEBUG, ("pbuf_header: old %p new %p (%"S16_F")\n", |
507 |
(void *)payload, (void *)p->payload, header_size_increment)); |
(void *)payload, (void *)p->payload, header_size_increment)); |
508 |
|
|
509 |
return 0; |
return 0; |
598 |
/* p->ref > 0, this pbuf is still referenced to */ |
/* p->ref > 0, this pbuf is still referenced to */ |
599 |
/* (and so the remaining pbufs in chain as well) */ |
/* (and so the remaining pbufs in chain as well) */ |
600 |
} else { |
} else { |
601 |
LWIP_DEBUGF( PBUF_DEBUG | 2, ("pbuf_free: %p has ref %u, ending here.\n", (void *)p, (unsigned int)p->ref)); |
LWIP_DEBUGF( PBUF_DEBUG | 2, ("pbuf_free: %p has ref %"U16_F", ending here.\n", (void *)p, (u16_t)p->ref)); |
602 |
/* stop walking through the chain */ |
/* stop walking through the chain */ |
603 |
p = NULL; |
p = NULL; |
604 |
} |
} |