From 30b061d8b1322c47f3935703bbbd511cc1e69871 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Fri, 11 Nov 2022 03:16:53 -0500 Subject: [PATCH] pool: do not inline function anymore to avoid conflicts with libxil Signed-off-by: Steffen Vogel --- include/villas/pool.hpp | 22 ++++------------------ lib/pool.cpp | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/include/villas/pool.hpp b/include/villas/pool.hpp index a32fe9d09..46f4dea31 100644 --- a/include/villas/pool.hpp +++ b/include/villas/pool.hpp @@ -33,7 +33,6 @@ struct Pool { struct CQueue queue; /**< The queue which is used to keep track of free blocks */ }; -#define INLINE static inline __attribute__((unused)) #define pool_buffer(p) ((char *) (p) + (p)->buffer_off) /** Initiazlize a pool @@ -56,29 +55,16 @@ int pool_destroy(struct Pool *p) __attribute__ ((warn_unused_result)); * This number can be smaller than the requested \p cnt blocks * in case the pool currently holds less than \p cnt blocks. */ -INLINE ssize_t pool_get_many(struct Pool *p, void *blocks[], size_t cnt) -{ - return queue_pull_many(&p->queue, blocks, cnt); -} +ssize_t pool_get_many(struct Pool *p, void *blocks[], size_t cnt); /** Push \p cnt values which are giving by the array values to the stack. */ -INLINE ssize_t pool_put_many(struct Pool *p, void *blocks[], size_t cnt) -{ - return queue_push_many(&p->queue, blocks, cnt); -} +ssize_t pool_put_many(struct Pool *p, void *blocks[], size_t cnt); /** Get a free memory block from pool. */ -INLINE void * pool_get(struct Pool *p) -{ - void *ptr; - return queue_pull(&p->queue, &ptr) == 1 ? ptr : nullptr; -} +void * pool_get(struct Pool *p); /** Release a memory block back to the pool. */ -INLINE int pool_put(struct Pool *p, void *buf) -{ - return queue_push(&p->queue, buf); -} +int pool_put(struct Pool *p, void *buf); } /* namespace node */ } /* namespace villas */ diff --git a/lib/pool.cpp b/lib/pool.cpp index 696693fd0..011101ea4 100644 --- a/lib/pool.cpp +++ b/lib/pool.cpp @@ -62,3 +62,24 @@ int villas::node::pool_destroy(struct Pool *p) return ret; } + +ssize_t villas::node::pool_get_many(struct Pool *p, void *blocks[], size_t cnt) +{ + return queue_pull_many(&p->queue, blocks, cnt); +} + +ssize_t villas::node::pool_put_many(struct Pool *p, void *blocks[], size_t cnt) +{ + return queue_push_many(&p->queue, blocks, cnt); +} + +void * villas::node::pool_get(struct Pool *p) +{ + void *ptr; + return queue_pull(&p->queue, &ptr) == 1 ? ptr : nullptr; +} + +int villas::node::pool_put(struct Pool *p, void *buf) +{ + return queue_push(&p->queue, buf); +}