mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-30 10:06:43 +00:00
BUG/MINOR: pools/buffers: make sure to always reserve the required buffers
Since recent commit ae07592 ("MEDIUM: pools: add CONFIG_HAP_NO_GLOBAL_POOLS and CONFIG_HAP_GLOBAL_POOLS") the pre-allocation of all desired reserved buffers was not done anymore on systems not using the shared cache. This basically has no practical impact since these ones will quickly be refilled by all the ones used at run time, but it may confuse someone checking if they're allocated in "show pools". That's only 2.4-dev, no backport is needed.
This commit is contained in:
parent
932dd19cc3
commit
a5b229d01d
12
src/dynbuf.c
12
src/dynbuf.c
@ -27,6 +27,7 @@ int init_buffer()
|
||||
{
|
||||
void *buffer;
|
||||
int thr;
|
||||
int done;
|
||||
|
||||
pool_head_buffer = create_pool("buffer", global.tune.bufsize, MEM_F_SHARED|MEM_F_EXACT);
|
||||
if (!pool_head_buffer)
|
||||
@ -47,11 +48,12 @@ int init_buffer()
|
||||
if (global.tune.buf_limit)
|
||||
pool_head_buffer->limit = global.tune.buf_limit;
|
||||
|
||||
buffer = pool_refill_alloc(pool_head_buffer, pool_head_buffer->minavail - 1);
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
pool_free(pool_head_buffer, buffer);
|
||||
for (done = 0; done < pool_head_buffer->minavail - 1; done++) {
|
||||
buffer = pool_refill_alloc(pool_head_buffer, 1);
|
||||
if (!buffer)
|
||||
return 0;
|
||||
pool_free(pool_head_buffer, buffer);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user