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

Re: BUG_ON()



Hi,

yalong <aginobili@xxxxxxxxx> writes:

> it&#39;s necessary for efficency of code.

Oh, nice to hear.

> when someCodition is FALSE, it&#39;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

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ