* Add control than the type and the oplist are compatible
This commit is contained in:
1 parent
9c58e73c37
commit
d1ae26f0fd
13 files changed
+38
No files matched your search
@@ -128,6 +128,9 @@
|
|||||||
|
|
||||||
#define ALGOI_DEF_P4(name, container_t, cont_oplist, type_t, type_oplist, it_t) \
|
#define ALGOI_DEF_P4(name, container_t, cont_oplist, type_t, type_oplist, it_t) \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, container_t, cont_oplist) \
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 2, type_t, type_oplist) \
|
||||||
|
\
|
||||||
ALGOI_CALLBACK_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \
|
ALGOI_CALLBACK_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t) \
|
||||||
M_IF_FUNCOBJ(ALGOI_FUNCOBJ_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t)) \
|
M_IF_FUNCOBJ(ALGOI_FUNCOBJ_P5(name, container_t, cont_oplist, type_t, type_oplist, it_t)) \
|
||||||
\
|
\
|
||||||
|
|||||||
@@ -162,6 +162,8 @@
|
|||||||
const struct M_C(name, _s) *array; /* Reference of the array */ \
|
const struct M_C(name, _s) *array; /* Reference of the array */ \
|
||||||
} it_t[1]; \
|
} it_t[1]; \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
static inline void \
|
static inline void \
|
||||||
M_C(name, _init)(array_t v) \
|
M_C(name, _init)(array_t v) \
|
||||||
{ \
|
{ \
|
||||||
|
|||||||
@@ -318,6 +318,9 @@
|
|||||||
int idx; \
|
int idx; \
|
||||||
} it_t[1]; \
|
} it_t[1]; \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, key_t, key_oplist) \
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 2, value_t, value_oplist) \
|
||||||
|
\
|
||||||
/* TODO: Can be optimized to alloc for leaf or for node */ \
|
/* TODO: Can be optimized to alloc for leaf or for node */ \
|
||||||
static inline node_t M_C(name, _new_node)(void) \
|
static inline node_t M_C(name, _new_node)(void) \
|
||||||
{ \
|
{ \
|
||||||
|
|||||||
@@ -137,6 +137,8 @@ typedef enum {
|
|||||||
typedef union { M_C(name, _srcptr) cptr; M_C(name, _ptr) ptr; } M_C(name, _uptr); \
|
typedef union { M_C(name, _srcptr) cptr; M_C(name, _ptr) ptr; } M_C(name, _uptr); \
|
||||||
typedef type M_C(name, _type_t); \
|
typedef type M_C(name, _type_t); \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
static inline void \
|
static inline void \
|
||||||
M_C(name, _init)(buffer_t v, size_t size) \
|
M_C(name, _init)(buffer_t v, size_t size) \
|
||||||
{ \
|
{ \
|
||||||
|
|||||||
@@ -151,6 +151,8 @@
|
|||||||
\
|
\
|
||||||
typedef type M_C(name, _type_t); \
|
typedef type M_C(name, _type_t); \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
/* Define the lock strategy (global & shared lock) */ \
|
/* Define the lock strategy (global & shared lock) */ \
|
||||||
static inline void \
|
static inline void \
|
||||||
M_C(name, _internal_init)(concurrent_t out) \
|
M_C(name, _internal_init)(concurrent_t out) \
|
||||||
|
|||||||
@@ -139,6 +139,8 @@
|
|||||||
\
|
\
|
||||||
typedef type M_C(name, _type_t); \
|
typedef type M_C(name, _type_t); \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
static inline M_C(name, _node_t)* \
|
static inline M_C(name, _node_t)* \
|
||||||
M_C(name, _int_new_node)(deque_t d) \
|
M_C(name, _int_new_node)(deque_t d) \
|
||||||
{ \
|
{ \
|
||||||
|
|||||||
@@ -250,6 +250,9 @@
|
|||||||
typedef key_type M_C(name, _key_type_t); \
|
typedef key_type M_C(name, _key_type_t); \
|
||||||
typedef value_type M_C(name, _value_type_t); \
|
typedef value_type M_C(name, _value_type_t); \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, key_type, key_oplist) \
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 2, value_type, value_oplist) \
|
||||||
|
\
|
||||||
typedef struct M_C(name, _it_s) { \
|
typedef struct M_C(name, _it_s) { \
|
||||||
M_C(name, _array_list_pair_it_t) array_it; \
|
M_C(name, _array_list_pair_it_t) array_it; \
|
||||||
M_C(name, _list_pair_it_t) list_it; \
|
M_C(name, _list_pair_it_t) list_it; \
|
||||||
@@ -1187,6 +1190,9 @@ typedef enum {
|
|||||||
size_t index; \
|
size_t index; \
|
||||||
} dict_it_t[1]; \
|
} dict_it_t[1]; \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, key_type, key_oplist) \
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 2, value_type, value_oplist) \
|
||||||
|
\
|
||||||
static inline void \
|
static inline void \
|
||||||
M_C(name,_int_limit)(dict_t dict, size_t size) \
|
M_C(name,_int_limit)(dict_t dict, size_t size) \
|
||||||
{ \
|
{ \
|
||||||
|
|||||||
@@ -161,6 +161,8 @@ typedef struct ilist_head_s {
|
|||||||
struct ilist_head_s *next; \
|
struct ilist_head_s *next; \
|
||||||
} it_t[1]; \
|
} it_t[1]; \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
static inline void M_C(name, _init)(list_t list) \
|
static inline void M_C(name, _init)(list_t list) \
|
||||||
{ \
|
{ \
|
||||||
assert (list != NULL); \
|
assert (list != NULL); \
|
||||||
|
|||||||
@@ -172,6 +172,8 @@
|
|||||||
struct M_C(name, _s) *current; \
|
struct M_C(name, _s) *current; \
|
||||||
} it_t[1]; \
|
} it_t[1]; \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
LISTI_MEMPOOL_DEF(name, type, oplist, list_t, it_t) \
|
LISTI_MEMPOOL_DEF(name, type, oplist, list_t, it_t) \
|
||||||
LISTI_DEF_P4(name, type, oplist, list_t, it_t) \
|
LISTI_DEF_P4(name, type, oplist, list_t, it_t) \
|
||||||
LISTI_ITBASE_DEF(name, type, oplist, list_t, it_t)
|
LISTI_ITBASE_DEF(name, type, oplist, list_t, it_t)
|
||||||
@@ -871,6 +873,8 @@
|
|||||||
struct M_C(name, _s) *current; \
|
struct M_C(name, _s) *current; \
|
||||||
} it_t[1]; \
|
} it_t[1]; \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
LISTI_MEMPOOL_DEF(name, type, oplist, list_t, it_t) \
|
LISTI_MEMPOOL_DEF(name, type, oplist, list_t, it_t) \
|
||||||
LISTI_DUAL_PUSH_DEF_P4(name, type, oplist, list_t, it_t) \
|
LISTI_DUAL_PUSH_DEF_P4(name, type, oplist, list_t, it_t) \
|
||||||
LISTI_ITBASE_DEF(name, type, oplist, list_t, it_t)
|
LISTI_ITBASE_DEF(name, type, oplist, list_t, it_t)
|
||||||
|
|||||||
@@ -114,6 +114,8 @@
|
|||||||
\
|
\
|
||||||
typedef M_C(name, _array_it_t) it_t; \
|
typedef M_C(name, _array_it_t) it_t; \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
static inline void \
|
static inline void \
|
||||||
M_C(name, _init)(prioqueue_t p) \
|
M_C(name, _init)(prioqueue_t p) \
|
||||||
{ \
|
{ \
|
||||||
|
|||||||
@@ -204,6 +204,8 @@ typedef enum {
|
|||||||
M_CALL_DEL(oplist, ptr); \
|
M_CALL_DEL(oplist, ptr); \
|
||||||
} ) \
|
} ) \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
RBTREEI_DEF_P4(name, type, oplist, tree_t, node_t, it_t)
|
RBTREEI_DEF_P4(name, type, oplist, tree_t, node_t, it_t)
|
||||||
|
|
||||||
#define RBTREEI_DEF_P4(name, type, oplist, tree_t, node_t, it_t) \
|
#define RBTREEI_DEF_P4(name, type, oplist, tree_t, node_t, it_t) \
|
||||||
|
|||||||
@@ -143,6 +143,8 @@ static inline int sharedi_integer_cref(int *p) { return *p; }
|
|||||||
struct M_C(name, _s) ptr; \
|
struct M_C(name, _s) ptr; \
|
||||||
} M_C(name, combine_t)[1]; \
|
} M_C(name, combine_t)[1]; \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
static inline void \
|
static inline void \
|
||||||
M_C(name, _init)(M_C(name, _t) shared) \
|
M_C(name, _init)(M_C(name, _t) shared) \
|
||||||
{ \
|
{ \
|
||||||
|
|||||||
@@ -152,6 +152,8 @@
|
|||||||
\
|
\
|
||||||
typedef type M_C(name, _type_t); \
|
typedef type M_C(name, _type_t); \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
static inline void M_C(name, _init)(M_C(name, _t) snap) \
|
static inline void M_C(name, _init)(M_C(name, _t) snap) \
|
||||||
{ \
|
{ \
|
||||||
assert(snap != NULL); \
|
assert(snap != NULL); \
|
||||||
@@ -532,6 +534,8 @@ static inline void snapshot_mrsw_int_read_end(snapshot_mrsw_int_t s, unsigned in
|
|||||||
\
|
\
|
||||||
typedef type M_C(name, _type_t); \
|
typedef type M_C(name, _type_t); \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
static inline void M_C(name, _init)(M_C(name, _t) snap, size_t nReader) \
|
static inline void M_C(name, _init)(M_C(name, _t) snap, size_t nReader) \
|
||||||
{ \
|
{ \
|
||||||
assert (snap != NULL); \
|
assert (snap != NULL); \
|
||||||
@@ -624,6 +628,8 @@ static inline void snapshot_mrsw_int_read_end(snapshot_mrsw_int_t s, unsigned in
|
|||||||
\
|
\
|
||||||
typedef type M_C(name, _type_t); \
|
typedef type M_C(name, _type_t); \
|
||||||
\
|
\
|
||||||
|
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
|
||||||
|
\
|
||||||
static inline void M_C(name, _init)(M_C(name, _t) snap, size_t nReader, size_t nWriter) \
|
static inline void M_C(name, _init)(M_C(name, _t) snap, size_t nReader, size_t nWriter) \
|
||||||
{ \
|
{ \
|
||||||
M_C(name, _mrsw_init)(snap->core, nReader + nWriter -1 ); \
|
M_C(name, _mrsw_init)(snap->core, nReader + nWriter -1 ); \
|
||||||
|
|||||||
Reference in new issue
Block a user