wasmi_core/hint.rs
1/// Indicates that the calling scope is unlikely to be executed.
2#[cold]
3#[inline]
4pub fn cold() {}
5
6/// Indicates that the condition is likely `true`.
7#[inline]
8pub fn likely(condition: bool) -> bool {
9 if !condition {
10 cold()
11 }
12 condition
13}
14
15/// Indicates that the condition is unlikely `true`.
16#[inline]
17pub fn unlikely(condition: bool) -> bool {
18 if condition {
19 cold()
20 }
21 condition
22}