Expand description
Re-export of the core::hint
module.
The only difference from the core::hint
module is that spin_loop
is available in all rust versions that this crate supports.
use portable_atomic::hint;
hint::spin_loop();
Functions§
- Makes a soundness promise to the compiler that
cond
holds. - An identity function that hints to the compiler to be maximally pessimistic about what
black_box
could do. - Emits a machine instruction to signal the processor that it is running in a busy-wait spin-loop (“spin lock”).
- Informs the compiler that the site which is calling this function is not reachable, possibly enabling further optimizations.
- must_
use Experimental An identity function that causes anunused_must_use
warning to be triggered if the given value is not used (returned, stored in a variable, etc) by the caller.