mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 07:31:11 +00:00
Use __predict_false() in the KASSERT() macro. We expect this test
to fail most of the time.
This commit is contained in:
parent
6e478cc056
commit
d68d22ba52
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120610
|
@ -45,6 +45,7 @@
|
|||
#include <machine/atomic.h>
|
||||
#include <machine/cpufunc.h>
|
||||
#include <sys/callout.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/queue.h>
|
||||
#include <sys/stdint.h> /* for people using printf mainly */
|
||||
|
||||
|
@ -77,7 +78,10 @@ extern int bootverbose; /* nonzero to print verbose messages */
|
|||
extern int maxusers; /* system tune hint */
|
||||
|
||||
#ifdef INVARIANTS /* The option is always available */
|
||||
#define KASSERT(exp,msg) do { if (!(exp)) panic msg; } while (0)
|
||||
#define KASSERT(exp,msg) do { \
|
||||
if (__predict_false(!(exp))) \
|
||||
panic msg; \
|
||||
} while (0)
|
||||
#else
|
||||
#define KASSERT(exp,msg)
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue