Friday, September 5, 2014

GNU C branch annotation


Two macro likely() and unlikely() can be specified to help the compiler to optimize code.

For example, if (unlikely(i > 10)) then ...

Uses this directives when one of the branch direction is overwhelmingly over the other.

No comments: