Workaround to avoid CLANG unused function warnings

This commit is contained in:
Patrick Pelissier committed 2020-07-09 22:14:00 +02:00
1 parent 7607645636
commit 8a36b5ff15
20 files changed
+130 -50

No files matched your search

+19 -13
View File
@@ -37,11 +37,27 @@
*ptr = 17;
mempool_uint_free(m, ptr);
mempool_uint_clear(m); // Give back memory to system
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
#define MEMPOOL_DEF(name, type) \
\
M_BEGIN_PROTECTED_CODE \
MEMPOOL_DEF_P2(name, type) \
M_END_PROTECTED_CODE
/* User shall be able to cutomize the size of the segment and/or
the minimun number of elements.
*/
#ifndef MEMPOOL_MAX_PER_SEGMENT
#define MEMPOOL_MAX_PER_SEGMENT(type) \
M_MAX((16*1024-sizeof(unsigned int) - 2*sizeof(void*)) / sizeof (type), 256U)
#endif
/********************************** INTERNAL ************************************/
#define MEMPOOL_DEF_P2(name, type) \
\
typedef union M_C(name,_union_s) { \
type t; \
union M_C(name,_union_s) *next; \
@@ -129,16 +145,6 @@
MEMPOOLI_CONTRACT(mem, type); \
} \
/* User shall be able to cutomize the size of the segment and/or
the minimun number of elements.
*/
#ifndef MEMPOOL_MAX_PER_SEGMENT
#define MEMPOOL_MAX_PER_SEGMENT(type) \
M_MAX((16*1024-sizeof(unsigned int) - 2*sizeof(void*)) / sizeof (type), 256U)
#endif
/********************************** INTERNAL ************************************/
#define MEMPOOLI_CONTRACT(mempool, type) do { \
assert((mempool) != NULL); \