Fix _push_move of SPSC. It shall take a pointer to the object, not the object itself as argument, just like the other _push_move

This commit is contained in:
Patrick Pelissier committed 2021-03-28 11:48:58 +02:00
1 parent 4b71bbec7e
commit 2e0fc21878
2 files changed
+5 -4

No files matched your search

+3 -3
View File
@@ -1021,7 +1021,7 @@ M_C(name, _init)(buffer_t v, size_t size) \
} \
\
static inline bool \
M_C(name, _push_move)(buffer_t table, type x) \
M_C(name, _push_move)(buffer_t table, type *x) \
{ \
M_QU3U3_SPSC_CONTRACT(table); \
unsigned int r = atomic_load_explicit(&table->consoIdx, \
@@ -1032,9 +1032,9 @@ M_C(name, _init)(buffer_t v, size_t size) \
return false; \
unsigned int i = w & (table->size -1); \
if (!M_BUFF3R_POLICY_P((policy), BUFFER_PUSH_INIT_POP_MOVE)) { \
M_DO_MOVE(oplist, table->Tab[i].x, x); \
M_DO_MOVE(oplist, table->Tab[i].x, *x); \
} else { \
M_DO_INIT_MOVE(oplist, table->Tab[i].x, x); \
M_DO_INIT_MOVE(oplist, table->Tab[i].x, *x); \
} \
atomic_store_explicit(&table->prodIdx, w+1, memory_order_release); \
M_QU3U3_SPSC_CONTRACT(table); \