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

Function opt_ref

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

Source from the content-addressed store, hash-verified

234/// syscall.
235#[inline]
236pub(super) fn opt_ref<T: Sized, Num: ArgNumber>(t: Option<&T>) -> ArgReg<'_, Num> {
237 // This optimizes into the equivalent of `transmute(t)`, and has the
238 // advantage of not requiring `unsafe`.
239 match t {
240 Some(t) => by_ref(t),
241 None => raw_arg(null_mut()),
242 }
243}
244
245/// Convert a `c_int` into an `ArgReg`.
246///

Callers 3

kernel_sigactionFunction · 0.85
kernel_sigaltstackFunction · 0.85
kernel_sigprocmaskFunction · 0.85

Calls 2

by_refFunction · 0.85
raw_argFunction · 0.85

Tested by

no test coverage detected