1
0
mirror of https://git.kore.io/kore.git synced 2024-11-18 16:08:29 +01:00

start enforcing a mininum number of elms in pools.

This commit is contained in:
Joris Vink 2018-10-30 10:41:49 +01:00
parent 71c145932c
commit 062c80c1ac

View File

@ -21,6 +21,8 @@
#include "kore.h"
#define POOL_MIN_ELEMENTS 16
#define POOL_ELEMENT_BUSY 0
#define POOL_ELEMENT_FREE 1
@ -38,6 +40,9 @@ kore_pool_init(struct kore_pool *pool, const char *name,
{
kore_debug("kore_pool_init(%p, %s, %zu, %zu)", pool, name, len, elm);
if (elm < POOL_MIN_ELEMENTS)
elm = POOL_MIN_ELEMENTS;
if ((pool->name = strdup(name)) == NULL)
fatal("kore_pool_init: strdup %s", errno_s);