Skip to content

Remove more unsafe code

Fixes #43 (closed)

This MR is related to #43 (closed) and attempts to reduce the use of unsafe.

It succeeds in removing some, but others remain, related to the use of the following unsafe functions:

  • slide::from_raw_parts_mut
  • File::from_raw_fd (could syscall::open return a File?)
  • libc::memalign
  • libc::free
  • ptr::copy
  • syscall::map and funmap

There remain 11 instances of unsafe in the crate, down from 20.

The end goal (that looks hard given the above list, would be to remove all unsafe references and add #![forbid(unsafe_code)] to the top of main.

Because that looks hard, I say above "Fixes #43 (closed)" and will close that issue. If someone wants to take another shot at this later, then great.

Merge request reports