probe-rs / rtt-target

Target side implementation of the RTT (Real-Time Transfer) I/O protocol
MIT License
123 stars 30 forks source link

Make more operations volatile and add compiler fences #6

Closed mvirkkunen closed 4 years ago

mvirkkunen commented 4 years ago

Related to issue #4.

Added some fences to prevent compiler reordering, and a rudimentary volatile version of ptr::copy_nonoverlapping. Unfortunately this thing is probably a bit less efficient than the standard library version which uses a nice LLVM intrinsic, but Rust doesn't expose the volatile flag of that intrinsic as a stable function currently.