diff options
author | unknown <marko@hundin.mysql.fi> | 2005-04-21 15:27:18 +0300 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2005-04-21 15:27:18 +0300 |
commit | 9eb919c5c7439451d0b200ea26ac2dcf9d7960d3 (patch) | |
tree | 95a3466cc1d65218a2a4fe27570c376a7910f3a8 | |
parent | 7e9f3a6d456c13d69e48b4de413cde36fd6a63d5 (diff) | |
download | mariadb-git-9eb919c5c7439451d0b200ea26ac2dcf9d7960d3.tar.gz |
InnoDB: Make branch prediction assume that assertions do not fail.
innobase/include/ut0dbg.h:
Remove ut_dbg_zero.
Use the UNIV_UNLIKELY() macro in assertions in order to assist branch
prediction.
innobase/ut/ut0dbg.c:
Remove ut_dbg_zero.
-rw-r--r-- | innobase/include/ut0dbg.h | 6 | ||||
-rw-r--r-- | innobase/ut/ut0dbg.c | 3 |
2 files changed, 2 insertions, 7 deletions
diff --git a/innobase/include/ut0dbg.h b/innobase/include/ut0dbg.h index 5f30a894874..a0af0e2f0ad 100644 --- a/innobase/include/ut0dbg.h +++ b/innobase/include/ut0dbg.h @@ -13,8 +13,6 @@ Created 1/30/1994 Heikki Tuuri #include <stdlib.h> #include "os0thread.h" -extern ulint ut_dbg_zero; /* This is used to eliminate - compiler warnings */ extern ibool ut_dbg_stop_threads; extern ulint* ut_dbg_null_ptr; @@ -26,7 +24,7 @@ extern const char* ut_dbg_msg_stop; #ifdef __NETWARE__ extern ibool panic_shutdown; #define ut_a(EXPR) do {\ - if (!((ulint)(EXPR) + ut_dbg_zero)) {\ + if (UNIV_UNLIKELY(!((ulint)(EXPR)))) {\ ut_print_timestamp(stderr);\ fprintf(stderr, ut_dbg_msg_assert_fail,\ os_thread_pf(os_thread_get_curr_id()), __FILE__,\ @@ -55,7 +53,7 @@ extern ibool panic_shutdown; } while (0) #else #define ut_a(EXPR) do {\ - if (!((ulint)(EXPR) + ut_dbg_zero)) {\ + if (UNIV_UNLIKELY(!((ulint)(EXPR)))) {\ ut_print_timestamp(stderr);\ fprintf(stderr, ut_dbg_msg_assert_fail,\ os_thread_pf(os_thread_get_curr_id()), __FILE__,\ diff --git a/innobase/ut/ut0dbg.c b/innobase/ut/ut0dbg.c index 0f6a27d35d9..ea3b48b6e9e 100644 --- a/innobase/ut/ut0dbg.c +++ b/innobase/ut/ut0dbg.c @@ -8,9 +8,6 @@ Created 1/30/1994 Heikki Tuuri #include "univ.i" -/* This is used to eliminate compiler warnings */ -ulint ut_dbg_zero = 0; - /* If this is set to TRUE all threads will stop into the next assertion and assert */ ibool ut_dbg_stop_threads = FALSE; |