From a6901b5bca85495252ae550b211fed5d703ec6e7 Mon Sep 17 00:00:00 2001 From: yuqing Date: Mon, 14 May 2018 18:19:58 +0800 Subject: [PATCH] fast_task_queue.c: set alloc_once gracefully --- src/fast_task_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fast_task_queue.c b/src/fast_task_queue.c index 6d1ba64..6942ad2 100644 --- a/src/fast_task_queue.c +++ b/src/fast_task_queue.c @@ -209,7 +209,7 @@ int free_queue_init_ex(const int max_connections, const int init_connections, alloc_once = MAX_DATA_SIZE / g_free_queue.block_size; if (g_free_queue.alloc_task_once > alloc_once) { - g_free_queue.alloc_task_once = alloc_once; + g_free_queue.alloc_task_once = alloc_once > 0 ? alloc_once : 1; } } else