Separate macro into smaller macros

to ease reading and enable easier customization of generation
This commit is contained in:
Patrick Pelissier committed 2023-01-20 23:45:40 +01:00
1 parent 4e5e498bb2
commit 4366e8eeab
1 file changed
+9
+9
View File
@@ -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) \