Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6334

__buildin_expect and if condition behaviour

$
0
0
  • I wonder how they achieved || functionality with (&& and unlikely) in the below piece of code.
if (unlikely(!arch_get_random_seed_long(&v)) && unlikely(!arch_get_random_long(&v))) {                break;   }
  • As per design, if arch_get_random_seed_long gets value &v there is no need to fill the value again in arch_get_random_long(). This piece of code working fine.

  • But, how do 'unlikely' achieve this. Skipping the remaining code after && once [unlikely(!0)] is achieved.

Thanks,Paavaanan


Viewing all articles
Browse latest Browse all 6334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>