Commit c546b5f3 authored by unknown's avatar unknown
Browse files

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.
parent 87c4f37a
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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__,\
+0 −3
Original line number Diff line number Diff line
@@ -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;