Skip to content

Commit

Permalink
docs: update safety comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptonemo committed Apr 26, 2021
1 parent e0a76ff commit bc199d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fr32/src/reader.rs
Expand Up @@ -68,6 +68,9 @@ impl<R: Read> Fr32Reader<R> {
fn process_block(&mut self) {
let in_buffer: &[u128] = {
#[cfg(target_arch = "aarch64")]
// Safety: This is safe because the struct is aligned on
// a 16 byte boundary and can therefore be casted from u128
// to u8 without alignment safety issues.
unsafe {
&mut (*(&self.in_buffer as *const [u8] as *mut [u128]))
}
Expand Down

0 comments on commit bc199d4

Please sign in to comment.