mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-22 12:30:07 +00:00
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.
This commit is contained in:
parent
f44ca97fcb
commit
7be7ffac15
@ -554,18 +554,6 @@ b_alloc | buffer *buf | ensures that <buf> is allocated or
|
||||
| | 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
|
||||
--------------------+------------------+---------------------------------------
|
||||
|
@ -79,27 +79,6 @@ static inline struct buffer *b_alloc(struct buffer *buf)
|
||||
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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user