iai_callgrind::client_requests::valgrind

Function non_simd_call0

source
pub fn non_simd_call0(func: fn(_: ThreadId) -> 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.

Note that the current ThreadId is inserted as the first argument. So this call:

non_simd_call0(func)

requires func to have this signature:

usize func(ThreadId tid)

Note that these client requests are not entirely reliable. For example, if you call a function with them that subsequently calls printf(), there’s a high chance Valgrind will crash. Generally, your prospects of these working are made higher if the called function does not refer to any global variables, and does not refer to other functions (print! et al.).