Can likely/unlikely macros be used in user-space code?

后端 未结 3 458
南笙
南笙 2020-12-14 07:35

I came across these 2 macros in Linux kernel code. I know they are instructions to compiler (gcc) for optimizations in case of branching. My question is, can we use these ma

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-14 08:15

    Take a look into What Every Programmer Should Know About Memory under "6.2.2 Optimizing Level 1 Instruction Cache Access" - there's a section about exactly this.

提交回复
热议问题