Movatterモバイル変換


[0]ホーム

URL:


Module hint

std

Modulehint 

1.27.0 ·Source
Expand description

Hints to compiler that affects how code should be emitted or optimized.

Hints may be compile time or runtime.

Functions§

assert_unchecked
Makes asoundness promise to the compiler thatcond holds.
black_box
An identity function thathints to the compiler to be maximally pessimistic about whatblack_box could do.
select_unpredictable
Returns eithertrue_val orfalse_val depending on the value ofcondition, with a hint to the compiler thatcondition is unlikely to becorrectly predicted by a CPU’s branch predictor.
spin_loop
Emits a machine instruction to signal the processor that it is running ina busy-wait spin-loop (“spin lock”).
unreachable_unchecked
Informs the compiler that the site which is calling this function is notreachable, possibly enabling further optimizations.
cold_pathExperimental
Hints to the compiler that given path is cold, i.e., unlikely to be taken. The compiler maychoose to optimize paths that are not cold at the expense of paths that are cold.
likelyExperimental
Hints to the compiler that a branch condition is likely to be true.Returns the value passed to it.
must_useExperimental
An identity function that causes anunused_must_use warning to betriggered if the given value is not used (returned, stored in a variable,etc) by the caller.
unlikelyExperimental
Hints to the compiler that a branch condition is unlikely to be true.Returns the value passed to it.

[8]ページ先頭

©2009-2026 Movatter.jp