Re: BUG_ON()

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

 



I am sorry for that. thanks, Hannes.
                      yalong

On Fri, Jul 4, 2008 at 10:51 AM, Johannes Weiner <hannes@xxxxxxxxxxxx> wrote:
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


[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