Separate macro into smaller macros
to ease reading and enable easier customization of generation
This commit is contained in:
1 parent
4e5e498bb2
commit
4366e8eeab
1 file changed
+9
@@ -73,6 +73,11 @@
|
|||||||
/********************************** INTERNAL ************************************/
|
/********************************** INTERNAL ************************************/
|
||||||
|
|
||||||
#define M_M3MPOOL_DEF_P2(name, type, name_t) \
|
#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. \
|
/* Define the type of element in a segment of the mempool. \
|
||||||
Either it is the basic type or a pointer to another one. */ \
|
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,_union_ct) *free_list; \
|
||||||
M_C(name,_segment_ct) *current_segment; \
|
M_C(name,_segment_ct) *current_segment; \
|
||||||
} name_t[1]; \
|
} name_t[1]; \
|
||||||
|
|
||||||
|
|
||||||
|
/* Define the core functions of the mempool */
|
||||||
|
#define M_M3MPOOL_DEF_CORE(name, type, name_t) \
|
||||||
\
|
\
|
||||||
static inline void \
|
static inline void \
|
||||||
M_C(name,_init)(name_t mem) \
|
M_C(name,_init)(name_t mem) \
|
||||||
|
|||||||
Reference in new issue
Block a user