Skip to main content

Module hint

Module hint 

Source
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();

Re-exports§

pub use hint::unreachable_unchecked;
pub use hint::assert_unchecked;
pub use hint::black_box;
pub use hint::must_use;
pub use hint::likely;
pub use hint::unlikely;
pub use hint::cold_path;
pub use hint::select_unpredictable;
pub use hint::prefetch_read;
pub use hint::prefetch_read_non_temporal;
pub use hint::prefetch_write;
pub use hint::prefetch_write_non_temporal;
pub use hint::prefetch_read_instruction;
pub use hint::Locality;

Functions§

spin_loop
Emits a machine instruction to signal the processor that it is running in a busy-wait spin-loop (“spin lock”).