From: Willy Tarreau Date: Thu, 13 Nov 2014 15:57:19 +0000 (+0100) Subject: MINOR: task: release the task pool when stopping X-Git-Tag: v1.6-dev1~274 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb11889f1e2002a7d5709db9d4b2979651108bee;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/include/proto/task.h b/include/proto/task.h index 4690670461..35d77daccc 100644 --- a/include/proto/task.h +++ b/include/proto/task.h @@ -32,6 +32,7 @@ #include #include +#include #include /* Principle of the wait queue. @@ -199,6 +200,8 @@ static inline struct task *task_new(void) static inline void task_free(struct task *t) { pool_free2(pool2_task, t); + if (unlikely(stopping)) + pool_flush2(pool2_task); nb_tasks--; }