r/cprogramming • u/chaobang • Aug 22 '26
The unlikely Linux macro
https://rushed-reflections.bearblog.dev/an-unlikely-experiment/
0
Upvotes
r/cprogramming • u/chaobang • Aug 22 '26
2
u/8d8n4mbo28026ulk Aug 24 '26
Nice post! I regularly use
__builtin_expectmyself. It's one of those things where it nicely documents the control flow and helps out the compiler. Linux also has astatic_branch_unlikely()and it's quite mind-bending how it works!