Marks private unchecked methods as unsafe and documents their safety requirements. Adds SAFETY comment for all unsafe uses. Use of copy_nonoverlapping ensures that compiler will not generate unreachable panic branches. Use of MaybeUninit removes unnecessary initialization and helps to test that we do not read bytes which were not written by us.
The code successfully passes MIRI tests, but I plan to test this implementation more thoroughly later.
Marks private
unchecked
methods asunsafe
and documents their safety requirements. AddsSAFETY
comment for allunsafe
uses. Use ofcopy_nonoverlapping
ensures that compiler will not generate unreachable panic branches. Use ofMaybeUninit
removes unnecessary initialization and helps to test that we do not read bytes which were not written by us.The code successfully passes MIRI tests, but I plan to test this implementation more thoroughly later.