fast_task_queue.c: set alloc_once gracefully

pull/37/head
yuqing 2018-05-14 18:19:58 +08:00
parent 679c8162fa
commit a6901b5bca
1 changed files with 1 additions and 1 deletions

View File

@ -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