CLEANUP: dynbuf: remove the unused b_alloc_fast() function
It is never used anymore since 1.7 where it was used by b_alloc_margin()
then replaced by direct calls to the pools function, and it maintains a
dependency on the exposed pools functions. It's time to get rid of it,
as it's not even certain it still works.
diff --git a/doc/internals/buffer-api.txt b/doc/internals/buffer-api.txt
index ccace49..ac35300 100644
--- a/doc/internals/buffer-api.txt
+++ b/doc/internals/buffer-api.txt
@@ -554,18 +554,6 @@
| | The allocated buffer is returned, or
| | NULL in case no memory is available
--------------------+------------------+---------------------------------------
-b_alloc_fast | buffer *buf | allocates a buffer and assigns it to
- | ret: buffer * | *buf. If no memory is available, (1)
- | | is assigned instead with a zero size.
- | | No control is made to check if *buf
- | | already pointed to another buffer. The
- | | allocated buffer is returned, or NULL
- | | in case no memory is available. The
- | | difference with b_alloc() is that this
- | | function only picks from the pool and
- | | never calls malloc(), so it can fail
- | | even if some memory is available
---------------------+------------------+---------------------------------------
__b_free | buffer *buf | releases <buf> which must be allocated
| ret: void | and marks it empty
--------------------+------------------+---------------------------------------
diff --git a/include/haproxy/dynbuf.h b/include/haproxy/dynbuf.h
index 6835cd6..2a90515 100644
--- a/include/haproxy/dynbuf.h
+++ b/include/haproxy/dynbuf.h
@@ -79,27 +79,6 @@
return buf;
}
-/* Allocates a buffer and assigns it to *buf. If no memory is available,
- * ((char *)1) is assigned instead with a zero size. No control is made to
- * check if *buf already pointed to another buffer. The allocated buffer is
- * returned, or NULL in case no memory is available. The difference with
- * b_alloc() is that this function only picks from the pool and never calls
- * malloc(), so it can fail even if some memory is available.
- */
-static inline struct buffer *b_alloc_fast(struct buffer *buf)
-{
- char *area;
-
- *buf = BUF_WANTED;
- area = pool_get_first(pool_head_buffer);
- if (unlikely(!area))
- return NULL;
-
- buf->area = area;
- buf->size = pool_head_buffer->size;
- return buf;
-}
-
/* Releases buffer <buf> (no check of emptiness). The buffer's head is marked
* empty.
*/