31 #ifndef UNIV_INNOCHECKSUM
35 #ifndef UNIV_HOTBACKUP
47 #define TEMP_INDEX_PREFIX '\377'
49 #define TEMP_INDEX_PREFIX_STR "\377"
54 #ifndef UNIV_HOTBACKUP
55 # if defined(HAVE_PAUSE_INSTRUCTION)
61 # define UT_RELAX_CPU() asm ("pause" )
63 # define UT_RELAX_CPU() __asm__ __volatile__ ("pause")
66 # elif defined(HAVE_FAKE_PAUSE_INSTRUCTION)
67 # define UT_RELAX_CPU() __asm__ __volatile__ ("rep; nop")
68 # elif defined(HAVE_ATOMIC_BUILTINS)
69 # define UT_RELAX_CPU() do { \
70 volatile lint volatile_var; \
71 os_compare_and_swap_lint(&volatile_var, 0, 1); \
73 # elif defined(HAVE_WINDOWS_ATOMICS)
77 # define UT_RELAX_CPU() YieldProcessor()
79 # define UT_RELAX_CPU() ((void)0)
87 #define UT_WAIT_FOR(cond, max_wait_us) \
90 start_us = ut_time_us(NULL); \
92 && ut_time_us(NULL) - start_us < (max_wait_us)) {\
94 os_thread_sleep(2000 ); \
99 template <
class T> T
ut_min(T a, T b) {
return(a < b ? a : b); }
100 template <
class T> T
ut_max(T a, T b) {
return(a > b ? a : b); }
156 #define ut_is_2pow(n) UNIV_LIKELY(!((n) & ((n) - 1)))
162 #define ut_2pow_remainder(n, m) ((n) & ((m) - 1))
169 #define ut_2pow_round(n, m) ((n) & ~((m) - 1))
174 #define ut_calc_align_down(n, m) ut_2pow_round(n, m)
181 #define ut_calc_align(n, m) (((n) + ((m) - 1)) & ~((m) - 1))
207 __attribute__((
const));
213 #define UT_BITS_IN_BYTES(b) (((b) + 7) / 8)
223 #ifndef UNIV_HOTBACKUP
287 UNIV_COLD __attribute__((nonnull));
289 #ifndef UNIV_INNOCHECKSUM
298 #ifdef UNIV_HOTBACKUP
304 ut_sprintf_timestamp_without_extra_chars(
311 ut_get_year_month_day(
346 #ifndef UNIV_HOTBACKUP
396 ulint formatted_size);
447 # define ut_vsnprintf(buf, size, fmt, ap) \
448 ((void) vsnprintf(buf, size, fmt, ap))
452 # define ut_snprintf snprintf
475 __attribute__((nonnull));