cvs commit: src/sys/sys cdefs.h
David Schultz
das at FreeBSD.ORG
Tue Sep 30 23:16:45 PDT 2003
On Tue, Sep 30, 2003, Maxime Henrion wrote:
> mux 2003/09/30 13:45:14 PDT
>
> FreeBSD src repository
>
> Modified files:
> sys/sys cdefs.h
> Log:
> Introduce new __predict_false(exp) and __predict_true(exp) keywords.
> Their purpose is to give explicit hints to the compiler to judge
> the likelyhood of a test to succeed or fail. Not all architectures
> have support for such optimizations, but for those who do, it can
> give a nice performance improvement in hot loops.
>
> Obviously, this should be used very rarely in very specific code.
>
> Reviewed by: peter
> Obtained from: OpenBSD
Cool, I'm glad we finally have these. (FWIW, I believe the macros
originated with NetBSD.) Hopefully they will be used with reservation.
More information about the cvs-src
mailing list