1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Branch prediction hints and compiler optimization helpers.
//!
//! These are micro-optimizations that help the compiler generate better code
//! for hot paths by providing hints about likely/unlikely branches.
/// Hint that a condition is likely to be true.
///
/// Use this on hot paths where the condition is almost always true.
/// Hint that a branch is unlikely to be taken.
///
/// Returns the value unchanged but hints to the compiler.
/// Hint that a branch is likely to be taken.
///
/// Returns the value unchanged but hints to the compiler.
/// Mark a code path as cold (rarely executed).
///
/// Use this for error handling paths.