Ruby 4.1.0dev (2026-11-12 revision e6e232d5facd495b6a7f143cf6e9c7960392ca25)
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