mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-30 06:48:02 +00:00
MINOR: task: release the task pool when stopping
When we're stopping, we're not going to create new tasks anymore, so let's release the task pool upon each task_free() in order to reduce memory fragmentation.
This commit is contained in:
parent
3a5e060bf6
commit
eb11889f1e
@ -32,6 +32,7 @@
|
|||||||
#include <common/ticks.h>
|
#include <common/ticks.h>
|
||||||
#include <eb32tree.h>
|
#include <eb32tree.h>
|
||||||
|
|
||||||
|
#include <types/global.h>
|
||||||
#include <types/task.h>
|
#include <types/task.h>
|
||||||
|
|
||||||
/* Principle of the wait queue.
|
/* Principle of the wait queue.
|
||||||
@ -199,6 +200,8 @@ static inline struct task *task_new(void)
|
|||||||
static inline void task_free(struct task *t)
|
static inline void task_free(struct task *t)
|
||||||
{
|
{
|
||||||
pool_free2(pool2_task, t);
|
pool_free2(pool2_task, t);
|
||||||
|
if (unlikely(stopping))
|
||||||
|
pool_flush2(pool2_task);
|
||||||
nb_tasks--;
|
nb_tasks--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user