Closed cvonelm closed 1 year ago
Use atomic_load_n and atomic_store_n. those are equivalent to the the smp_load_acquire and smp_store_release functions used in ring_buffer.h in the linux kernel.
As a proof, they produce the exact same assembly on
x86: https://godbolt.org/z/s7cMoe5vK
and
ARM: https://godbolt.org/z/6oYrKnbzv
This fixes #287
The Actual implementation further down uses smp_load_acquire() and smp_store_release()
Use atomic_load_n and atomic_store_n. those are equivalent to the the smp_load_acquire and smp_store_release functions used in ring_buffer.h in the linux kernel.
As a proof, they produce the exact same assembly on
x86: https://godbolt.org/z/s7cMoe5vK
and
ARM: https://godbolt.org/z/6oYrKnbzv
This fixes #287