41 #ifndef UNIV_HOTBACKUP
51 #define TEMP_INDEX_PREFIX '\377'
53 #define TEMP_INDEX_PREFIX_STR "\377"
58 #ifndef UNIV_HOTBACKUP
59 #if defined(HAVE_PAUSE_INSTRUCTION)
64 # define UT_RELAX_CPU() __asm__ __volatile__ ("pause")
65 #elif defined(HAVE_FAKE_PAUSE_INSTRUCTION)
66 # define UT_RELAX_CPU() __asm__ __volatile__ ("rep; nop")
67 #elif defined(HAVE_ATOMIC_BUILTINS)
68 # define UT_RELAX_CPU() do { \
69 volatile lint volatile_var; \
70 if (os_compare_and_swap_lint(&volatile_var, 0, 1)) ((void)0); \
72 #elif defined(HAVE_WINDOWS_ATOMICS)
76 # define UT_RELAX_CPU() YieldProcessor()
78 # define UT_RELAX_CPU() ((void)0)
86 #define UT_WAIT_FOR(cond, max_wait_us) \
89 start_us = ut_time_us(NULL); \
91 && ut_time_us(NULL) - start_us < (max_wait_us)) {\
93 os_thread_sleep(2000 ); \
162 #define ut_is_2pow(n) UNIV_LIKELY(!((n) & ((n) - 1)))
168 #define ut_2pow_remainder(n, m) ((n) & ((m) - 1))
175 #define ut_2pow_round(n, m) ((n) & ~(typeof(n))((m) - 1))
180 #define ut_calc_align_down(n, m) ut_2pow_round(n, m)
187 #define ut_calc_align(n, m) (((n) + ((m) - 1)) & ~(typeof(n))((m) - 1))
213 __attribute__((
const));
219 #define UT_BITS_IN_BYTES(b) (((b) + 7) / 8)
229 #ifndef UNIV_HOTBACKUP
287 #ifdef UNIV_HOTBACKUP
293 ut_sprintf_timestamp_without_extra_chars(
300 ut_get_year_month_day(
335 #ifndef UNIV_HOTBACKUP
398 # define ut_snprintf snprintf
UNIV_INLINE ulint ut_2_exp(ulint n)
UNIV_INTERN ulint ut_time_ms(void)
UNIV_INTERN void ut_print_namel(FILE *f, struct trx_struct *trx, ibool table_id, const char *name, ulint namelen)
UNIV_INTERN ib_time_t ut_time(void)
UNIV_INTERN void ut_print_filename(FILE *f, const char *name)
UNIV_INTERN ulint ut_get_high32(ulint a)
UNIV_INTERN void ut_print_buf(FILE *file, const void *buf, ulint len)
UNIV_INTERN ulint ut_2_power_up(ulint n) __attribute__((const ))
UNIV_INLINE void ut_pair_min(ulint *a, ulint *b, ulint a1, ulint b1, ulint a2, ulint b2)
UNIV_INTERN ullint ut_time_us(ullint *tloc)
UNIV_INLINE ulint ut_min(ulint n1, ulint n2)
UNIV_INTERN const char * ut_strerr(enum db_err num)
UNIV_INLINE ulint ut_max(ulint n1, ulint n2)
UNIV_INTERN void ut_print_name(FILE *f, struct trx_struct *trx, ibool table_id, const char *name)
UNIV_INTERN void ut_sprintf_timestamp(char *buf)
UNIV_INTERN ulint ut_delay(ulint delay)
UNIV_INTERN int ut_usectime(ulint *sec, ulint *ms)
UNIV_INLINE ulint ut_2_log(ulint n)
UNIV_INTERN void ut_print_timestamp(FILE *file)
UNIV_INLINE int ut_ulint_cmp(ulint a, ulint b)
UNIV_INTERN void ut_copy_file(FILE *dest, FILE *src)
UNIV_INLINE int ut_pair_cmp(ulint a1, ulint a2, ulint b1, ulint b2)
UNIV_INTERN double ut_difftime(ib_time_t time2, ib_time_t time1)