--- libelwix/inc/elwix/aring.h 2025/09/26 10:16:59 1.2 +++ libelwix/inc/elwix/aring.h 2025/09/30 11:33:20 1.3.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aring.h,v 1.2 2025/09/26 10:16:59 misho Exp $ +* $Id: aring.h,v 1.3.2.1 2025/09/30 11:33:20 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -46,12 +46,13 @@ SUCH DAMAGE. #ifndef __ARING_H #define __ARING_H +#define E_ATOMIC_ALIGN alignas(sizeof(int) * 8) typedef struct { - atomic_int rb_head; - atomic_int rb_tail; - int rb_bufnum; - struct iovec *rb_buffer; + E_ATOMIC_ALIGN int rb_head; + E_ATOMIC_ALIGN int rb_tail; + int rb_bufnum; + struct iovec *rb_buffer; } ringbuf_t; @@ -108,7 +109,7 @@ int rbuf_enqueue(ringbuf_t *rbuf, void *data, size_t l * @out = Data, if =NULL, just dequeue data * return: -1 error, 1 buffer is empty or 0 ok */ -int rbuf_dequeue(ringbuf_t *rbuf, struct iovec *out); +int rbuf_dequeue(ringbuf_t *rbuf, struct iovec **out); #endif