lilypond-devel
[Top][All Lists]
Advanced

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

likely/unlikely macros


From: Dan Eble
Subject: likely/unlikely macros
Date: Wed, 6 May 2015 08:56:36 -0400

http://stackoverflow.com/questions/109710/likely-unlikely-macros-in-the-linux-kernel-how-do-they-work-whats-their

> #define likely(x) __builtin_expect((x),1)
> #define unlikely(x) __builtin_expect((x),0)

Are there any objections to adding something like these to Lilypond?  (I’d use 
static_cast<bool>(x) though.)

An obvious place to use these is around the predicate in LY_ASSERT_TYPE where 
failure is unlikely.  I’m sure you can think of several more.
— 
Dan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]