rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.75k stars 256 forks source link

Fixes double bug in Send-Sync example #401

Closed Mottl closed 1 year ago

Mottl commented 1 year ago

Fixes double bug in the call to libc::posix_memalign which causes SIGSEGV due to incorrect pointer parameter and EINVAL (retval=22) due to incorrect alignment when size of T is less then size of usize.