wasmi_core/
hint.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/// Indicates that the calling scope is unlikely to be executed.
#[cold]
#[inline]
pub fn cold() {}

/// Indicates that the condition is likely `true`.
#[inline]
pub fn likely(condition: bool) -> bool {
    if !condition {
        cold()
    }
    condition
}

/// Indicates that the condition is unlikely `true`.
#[inline]
pub fn unlikely(condition: bool) -> bool {
    if condition {
        cold()
    }
    condition
}