31 #ifndef UNIV_INNOCHECKSUM
35 #ifndef UNIV_HOTBACKUP
47 #define TEMP_INDEX_PREFIX '\377'
49 #define TEMP_INDEX_PREFIX_STR "\377"
67 #ifndef UNIV_HOTBACKUP
68 # if defined(HAVE_PAUSE_INSTRUCTION)
74 # define UT_RELAX_CPU() asm ("pause" )
76 # define UT_RELAX_CPU() __asm__ __volatile__ ("pause")
79 # elif defined(HAVE_FAKE_PAUSE_INSTRUCTION)
80 # define UT_RELAX_CPU() __asm__ __volatile__ ("rep; nop")
81 # elif defined(HAVE_ATOMIC_BUILTINS)
82 # define UT_RELAX_CPU() do { \
83 volatile lint volatile_var; \
84 os_compare_and_swap_lint(&volatile_var, 0, 1); \
86 # elif defined(HAVE_WINDOWS_ATOMICS)
90 # define UT_RELAX_CPU() YieldProcessor()
92 # define UT_RELAX_CPU() ((void)0)
100 #define UT_WAIT_FOR(cond, max_wait_us) \
103 start_us = ut_time_us(NULL); \
105 && ut_time_us(NULL) - start_us < (max_wait_us)) {\
107 os_thread_sleep(2000 ); \
112 template <
class T> T ut_min(T a, T b) {
return(a < b ? a : b); }
113 template <
class T> T ut_max(T a, T b) {
return(a > b ? a : b); }
169 #define ut_is_2pow(n) UNIV_LIKELY(!((n) & ((n) - 1)))
175 #define ut_2pow_remainder(n, m) ((n) & ((m) - 1))
182 #define ut_2pow_round(n, m) ((n) & ~((m) - 1))
187 #define ut_calc_align_down(n, m) ut_2pow_round(n, m)
194 #define ut_calc_align(n, m) (((n) + ((m) - 1)) & ~((m) - 1))
220 __attribute__((
const));
226 #define UT_BITS_IN_BYTES(b) (((b) + 7) / 8)
236 #ifndef UNIV_HOTBACKUP
300 UNIV_COLD __attribute__((nonnull));
302 #ifndef UNIV_INNOCHECKSUM
311 #ifdef UNIV_HOTBACKUP
317 ut_sprintf_timestamp_without_extra_chars(
324 ut_get_year_month_day(
359 #ifndef UNIV_HOTBACKUP
409 ulint formatted_size);
460 # define ut_vsnprintf(buf, size, fmt, ap) \
461 ((void) vsnprintf(buf, size, fmt, ap))
465 # define ut_snprintf snprintf
488 __attribute__((nonnull));