On Fri, Jul 4, 2008 at 10:51 AM, Johannes Weiner <
hannes@xxxxxxxxxxxx> wrote:
Hi,
yalong <aginobili@xxxxxxxxx> writes:
> it's necessary for efficency of code.
Oh, nice to hear.
> when someCodition is FALSE, it's no cost on BUG(). but when you
> changed to BUG_ON(), there is always a cost on BUG_ON() both TRUE and
> FALSE.
From bug.h:
#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
Having at least a small glance at the definition before replying FUD
would have been too much?
Two or three architectures define their own BUG_ON() but, random guess,
only because they can check for the condition and raise an exception
faster than the generic version.
Hannes