]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: buffer: implement b_alloc_fast()
authorWilly Tarreau <w@1wt.eu>
Mon, 8 Dec 2014 15:37:26 +0000 (16:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Dec 2014 22:47:32 +0000 (23:47 +0100)
commit620bd6c88e3999b5a4b3b5c6fd8933ee47a1bc8b
tree9f7be5f47ac77325cd8692f43873ddd166196558
parent909e267be01592785bfd52edf1ed59c99a5189f1
MINOR: buffer: implement b_alloc_fast()

This function allocates a buffer and replaces *buf with this buffer. If
no memory is available, &buf_wanted is used instead. 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. It is the
caller's job to refill the buffer pool if needed.
include/common/buffer.h