]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: memory: add a callback function to create a pool
authorWilly Tarreau <w@1wt.eu>
Mon, 26 Nov 2018 10:44:35 +0000 (11:44 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 26 Nov 2018 18:50:32 +0000 (19:50 +0100)
commit7107c8b4943f7ee58dc4d66e5572a237b1860c7c
tree81e7da9341e8af65b59ed89a23d7f385bd18acc5
parente655251e80a927b2792ebae2ea50903c55c675a4
MINOR: memory: add a callback function to create a pool

The new function create_pool_callback() takes 3 args including the
return pointer, and creates a pool with the specified name and size.
In case of allocation error, it emits an error message and returns.

The new macro REGISTER_POOL() registers a callback using this function
and will be usable to request some pools creation and guarantee that
the allocation will be checked. An even simpler approach is to use
DECLARE_POOL() and DECLARE_STATIC_POOL() which declare and register
the pool.
include/common/memory.h
src/memory.c