pub enum Predictor {
Expect,
NeverReturns,
ColdCall,
LoopExit,
LoopGuard,
PointerNotNull,
NegativeReturn,
NullReturn,
CallNotTaken,
Continue,
Nothing,
}Expand description
Which predictor decided a branch.
In the order they are asked, which is section 11.2’s order, so a comparison between two of these says which one wins where both apply.
Variants§
Expect
__builtin_expect named an arm.
NeverReturns
One arm does not come back.
ColdCall
One arm calls a function the user marked cold.
LoopExit
One arm leaves the loop and the other stays in it.
LoopGuard
The branch decides whether to run a loop at all.
PointerNotNull
The condition compares a pointer against null.
NegativeReturn
One arm returns a negative constant.
NullReturn
One arm returns a null pointer.
CallNotTaken
One arm contains a call and the other does not.
Continue
One arm goes back to the top of the loop.
Nothing
Nothing applied, so the arms are even.
Implementations§
Trait Implementations§
impl Copy for Predictor
impl Eq for Predictor
Source§impl Ord for Predictor
impl Ord for Predictor
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Predictor
impl PartialOrd for Predictor
impl StructuralPartialEq for Predictor
Auto Trait Implementations§
impl Freeze for Predictor
impl RefUnwindSafe for Predictor
impl Send for Predictor
impl Sync for Predictor
impl Unpin for Predictor
impl UnsafeUnpin for Predictor
impl UnwindSafe for Predictor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more