[rtems-libbsd commit] BSD_ASSERT(): Optimize

Sebastian Huber sebh at rtems.org
Wed Sep 24 14:20:31 UTC 2014


Module:    rtems-libbsd
Branch:    master
Commit:    ccbc70df3e7f2d872639767208d36178dfe65ea5
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=ccbc70df3e7f2d872639767208d36178dfe65ea5

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Sep 24 16:28:25 2014 +0200

BSD_ASSERT(): Optimize

---

 rtemsbsd/include/machine/rtems-bsd-kernel-space.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/rtemsbsd/include/machine/rtems-bsd-kernel-space.h b/rtemsbsd/include/machine/rtems-bsd-kernel-space.h
index b8e8a7e..7e23edd 100644
--- a/rtemsbsd/include/machine/rtems-bsd-kernel-space.h
+++ b/rtemsbsd/include/machine/rtems-bsd-kernel-space.h
@@ -65,7 +65,7 @@ void rtems_bsd_assert_func(const char *file, int line, const char *func, const c
 #ifdef RTEMS_BSD_NO_ASSERT
 # define BSD_ASSERT(expr) ((void) 0)
 #else
-# define BSD_ASSERT(expr) ((expr) ? (void) 0 : rtems_bsd_assert_func(__FILE__, __LINE__, __func__, #expr))
+# define BSD_ASSERT(expr) (__predict_true(expr) ? (void) 0 : rtems_bsd_assert_func(__FILE__, __LINE__, __func__, #expr))
 #endif
 
 /* General definitions */



More information about the vc mailing list