Clean up
This commit is contained in:
1 parent
325d118260
commit
ab5a3ce31b
1 file changed
+4
-4
+4
-4
@@ -40,8 +40,6 @@
|
|||||||
*/
|
*/
|
||||||
// NOTE: Can not use m-list since it may be expanded from LIST_DEF
|
// NOTE: Can not use m-list since it may be expanded from LIST_DEF
|
||||||
|
|
||||||
// TODO: user shall be able to cutomize the size of the segment.
|
|
||||||
|
|
||||||
#define MEMPOOL_DEF(name, type) \
|
#define MEMPOOL_DEF(name, type) \
|
||||||
\
|
\
|
||||||
typedef union M_C(name,_union_s) { \
|
typedef union M_C(name,_union_s) { \
|
||||||
@@ -55,7 +53,7 @@
|
|||||||
M_C(name,_union_t) tab[MEMPOOLI_MAX_PER_SEGMENT(type)]; \
|
M_C(name,_union_t) tab[MEMPOOLI_MAX_PER_SEGMENT(type)]; \
|
||||||
} M_C(name,_segment_t); \
|
} M_C(name,_segment_t); \
|
||||||
\
|
\
|
||||||
typedef struct { \
|
typedef struct M_C(name, _s) { \
|
||||||
M_C(name,_union_t) *free_list; \
|
M_C(name,_union_t) *free_list; \
|
||||||
M_C(name,_segment_t) *current_segment; \
|
M_C(name,_segment_t) *current_segment; \
|
||||||
} M_C(name,_t)[1]; \
|
} M_C(name,_t)[1]; \
|
||||||
@@ -133,7 +131,9 @@
|
|||||||
|
|
||||||
/********************************** INTERNAL ************************************/
|
/********************************** INTERNAL ************************************/
|
||||||
|
|
||||||
#define MEMPOOLI_MAX_PER_SEGMENT(type) M_MAX((16*1024-sizeof(unsigned int) - 2*sizeof(void*)) / sizeof (type), 256U)
|
// TODO: user shall be able to cutomize the size of the segment.
|
||||||
|
#define MEMPOOLI_MAX_PER_SEGMENT(type) \
|
||||||
|
M_MAX((16*1024-sizeof(unsigned int) - 2*sizeof(void*)) / sizeof (type), 256U)
|
||||||
|
|
||||||
#define MEMPOOLI_CONTRACT(mempool, type) do { \
|
#define MEMPOOLI_CONTRACT(mempool, type) do { \
|
||||||
assert((mempool) != NULL); \
|
assert((mempool) != NULL); \
|
||||||
|
|||||||
Reference in new issue
Block a user