diff --git a/src/mem/mem_pool.c b/src/mem/mem_pool.c index 3ac6a61bf..10f20e61a 100644 --- a/src/mem/mem_pool.c +++ b/src/mem/mem_pool.c @@ -165,8 +165,8 @@ struct mem_pool_entry *mem_pool_borrow(struct mem_pool *pool) if (!pool) return NULL; - for (size_t i = re_atomic_acq(&pool->next_free); i < pool->nmemb; - i++) { + for (size_t i = (size_t)re_atomic_acq(&pool->next_free); + i < pool->nmemb; i++) { if (!re_atomic_acq(&pool->objs[i].used)) { re_atomic_rls_set(&pool->objs[i].used, true); re_atomic_rls_set(&pool->next_free, i + 1);