(t: Option<&mut T>)
| 222 | /// syscall. |
| 223 | #[inline] |
| 224 | pub(super) fn opt_mut<T: Sized, Num: ArgNumber>(t: Option<&mut T>) -> ArgReg<'_, Num> { |
| 225 | // This optimizes into the equivalent of `transmute(t)`, and has the |
| 226 | // advantage of not requiring `unsafe`. |
| 227 | match t { |
| 228 | Some(t) => by_mut(t), |
| 229 | None => raw_arg(null_mut()), |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | /// Convert an optional immutable reference into a `usize` for passing to a |
| 234 | /// syscall. |