| | never calls malloc(), so it can fail
| | even if some memory is available
--------------------+------------------+---------------------------------------
-__b_drop | buffer *buf | releases <buf> which must be allocated
- | ret: void | and marks it empty
---------------------+------------------+---------------------------------------
-b_drop | buffer *buf | releases <buf> only if it is allocated
+__b_free | buffer *buf | releases <buf> which must be allocated
| ret: void | and marks it empty
--------------------+------------------+---------------------------------------
b_free | buffer *buf | releases <buf> only if it is allocated
/* Releases buffer <buf> (no check of emptiness). The buffer's head is marked
* empty.
*/
-static inline void __b_drop(struct buffer *buf)
+static inline void __b_free(struct buffer *buf)
{
char *area = buf->area;
pool_free(pool_head_buffer, area);
}
-/* Releases buffer <buf> if allocated, and marks it empty. */
-static inline void b_drop(struct buffer *buf)
-{
- if (buf->size)
- __b_drop(buf);
-}
-
/* Releases buffer <buf> if allocated, and marks it empty. */
static inline void b_free(struct buffer *buf)
{
- b_drop(buf);
+ if (buf->size)
+ __b_free(buf);
}
/* Ensures that <buf> is allocated. If an allocation is needed, it ensures that
HA_SPIN_UNLOCK(BUF_WQ_LOCK, &buffer_wq_lock);
}
if (s->req.buf.size || s->res.buf.size) {
- b_drop(&s->req.buf);
- b_drop(&s->res.buf);
+ b_free(&s->req.buf);
+ b_free(&s->res.buf);
offer_buffers(NULL, tasks_run_queue);
}