Re: Unlikely and likely() functions....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



They are basically hints for the compiler, telling it whether a
condition is likely or not.  Based on this knowledge, the compiler can
optimize the code better, by doing things such as improving cache
locality for the code.

Avishay Traeger
http://www.fsl.cs.sunysb.edu/~avishay/

On Thu, 2006-01-05 at 12:21 +0530, charan raj wrote:
>  
> I am new to this mailing list .....
>  
> i just came across this  unlikely() and likely() function in kernel
> code ( eg  .. unlikely() is used in fork.c )  , i don;t have any idea
> about what the above 2 functions does ...... 
>  
> can anybody plz explain what the two functions all about .....
>  
>  
>  


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux