|
|
| version 1.4.4.1, 2026/02/10 15:49:08 | version 1.4.4.2, 2026/02/10 17:24:39 |
|---|---|
| Line 58 typedef struct { | Line 58 typedef struct { |
| typedef struct { | typedef struct { |
| E_ATOMIC_ALIGN unsigned int lrb_head; | E_ATOMIC_ALIGN unsigned int lrb_head; |
| E_ATOMIC_ALIGN unsigned int lrb_tail; | E_ATOMIC_ALIGN unsigned int lrb_tail; |
| E_ATOMIC_ALIGN unsigned int lrb_full; | |
| int lrb_size; | int lrb_size; |
| unsigned char *lrb_data; | unsigned char *lrb_data; |
| } lrbuf_t; | } lrbuf_t; |
| Line 65 typedef struct { | Line 66 typedef struct { |
| u_int _h, _t; \ | u_int _h, _t; \ |
| _t = atomic_load_explicit((atomic_int*) &(x)->lrb_tail, memory_order_acquire); \ | _t = atomic_load_explicit((atomic_int*) &(x)->lrb_tail, memory_order_acquire); \ |
| _h = atomic_load_explicit((atomic_int*) &(x)->lrb_head, memory_order_relaxed); \ | _h = atomic_load_explicit((atomic_int*) &(x)->lrb_head, memory_order_relaxed); \ |
| (r) = (_h + (x)->lrb_size - _t) % (x)->lrb_size; \ | if (_h == _t) \ |
| (r) = atomic_load_explicit((atomic_int*) &(x)->lrb_full, memory_order_acquire) ? \ | |
| (x)->lrb_size : 0; \ | |
| else \ | |
| (r) = (_h + (x)->lrb_size - _t) % (x)->lrb_size; \ | |
| } while (0) | } while (0) |
| #define lrb_unused(x, r) do { \ | #define lrb_unused(x, r) do { \ |
| u_int _r; \ | u_int _r; \ |