Ruby 4.1.0dev (2026-11-12 revision acc624e47b178e3514d848a949f8e25d4e49e175)
branch.h
Go to the documentation of this file.
1
4#ifndef PRISM_COMPILER_BRANCH_H
5#define PRISM_COMPILER_BRANCH_H
6
12#if defined(__GNUC__) || defined(__clang__)
14 #define PRISM_LIKELY(x) __builtin_expect(!!(x), 1)
15
17 #define PRISM_UNLIKELY(x) __builtin_expect(!!(x), 0)
18#else
20 #define PRISM_LIKELY(x) (x)
21
23 #define PRISM_UNLIKELY(x) (x)
24#endif
25
26#endif