iai_callgrind::client_requests::valgrind

Function non_simd_call1

source
pub fn non_simd_call1(
    func: fn(_: ThreadId, _: usize) -> usize,
    arg1: usize,
) -> usize
Available on crate feature client_requests_defs only.
Expand description

Allow control to move from the simulated CPU to the real CPU, calling an arbitrary function.

See also non_simd_call0

ยงExamples

let num = 42i32;
let res = iai_callgrind::client_requests::valgrind::non_simd_call1(
    |_tid, a| unsafe { ((a as *const i32).as_ref().unwrap() + 2) as usize },
    (&num) as *const i32 as usize,
);
assert_eq!(res, 44);