rokdocs
v0.1

rok::core::hint

rok::core::hint - hints the optimizer honors.

Functions

black_box

pub fn black_box<T>(x: T) -> T

An identity the optimizer cannot see through. Returns x unchanged, but will not fold away the computation that produced it, nor assume the result: x is routed through its own address with a volatile load. Benchmarks (spec 9.9.11) wrap the inputs and the result of a timed region with it so the work is actually performed.