[#1481] byte-wise atomic wrapper to prevent UB#1577
[#1481] byte-wise atomic wrapper to prevent UB#1577FerdinandSpitzschnueffler wants to merge 23 commits intoeclipse-iceoryx:mainfrom
Conversation
Rename __for_each_field, add documentation, replace std::thread/barrier in tests and add miri related todo, remove unnecessary dependencies
There was a problem hiding this comment.
The changes to this file were made because the tests didn't compile for reasons other than those stated in the test names.
76a5217 to
fbbb874
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1577 +/- ##
==========================================
- Coverage 77.70% 77.59% -0.11%
==========================================
Files 419 421 +2
Lines 40284 40442 +158
Branches 1297 1297
==========================================
+ Hits 31302 31381 +79
- Misses 7928 8007 +79
Partials 1054 1054
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| /// * See Safety section of [`crate::zero_copy_send::ZeroCopySend`]. | ||
| /// * Implementations of this trait must ensure that the offset and size of each field are | ||
| /// calculated correctly. Otherwise, undefined behavior may occur. | ||
| pub unsafe trait AtomicCopy: ZeroCopySend + Copy + 'static { |
There was a problem hiding this comment.
I think ZeroCopySend is strictly speaking not needed for AtomicCopy. First of all, it does not have any dependencies to ZeroCopySend or things that trait provides and AtomicCopy does not require #[repr(C)]. It could be used also in just one process and the member ordering can be anything.
Notes for Reviewer
To handle padding bytes in the wrapper
ByteAtomic, the new traitAtomicCopywas introduced. It basically provides a method to apply a callback to each offset-size pair of every field of a type.Pre-Review Checklist for the PR Author
Convert to draft)iox2-123-introduce-posix-ipc-example)[#123] Add posix ipc example)PR Reviewer Reminders
References
Closes #1481