MCPcopy Create free account
hub / github.com/bytecodealliance/rustix / opt_mut

Function opt_mut

src/backend/linux_raw/conv.rs:224–231  ·  view source on GitHub ↗
(t: Option<&mut T>)

Source from the content-addressed store, hash-verified

222/// syscall.
223#[inline]
224pub(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.

Callers

nothing calls this directly

Calls 2

by_mutFunction · 0.85
raw_argFunction · 0.85

Tested by

no test coverage detected