From 4366e8eeab974a3e3638f25004aaefdebbad6d6d Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Fri, 20 Jan 2023 23:34:06 +0100 Subject: [PATCH] Separate macro into smaller macros to ease reading and enable easier customization of generation --- m-mempool.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/m-mempool.h b/m-mempool.h index 5293cfb2..19c89782 100644 --- a/m-mempool.h +++ b/m-mempool.h @@ -73,6 +73,11 @@ /********************************** INTERNAL ************************************/ #define M_M3MPOOL_DEF_P2(name, type, name_t) \ + M_M3MPOOL_DEF_TYPE(name, type, name_t) \ + M_M3MPOOL_DEF_CORE(name, type, name_t) + +/* Define the types of the mempool */ +#define M_M3MPOOL_DEF_TYPE(name, type, name_t) \ \ /* Define the type of element in a segment of the mempool. \ Either it is the basic type or a pointer to another one. */ \ @@ -96,6 +101,10 @@ M_C(name,_union_ct) *free_list; \ M_C(name,_segment_ct) *current_segment; \ } name_t[1]; \ + + +/* Define the core functions of the mempool */ +#define M_M3MPOOL_DEF_CORE(name, type, name_t) \ \ static inline void \ M_C(name,_init)(name_t mem) \