MySQL 9.0.0
Source Code Documentation
|
Various utilities. More...
Namespaces | |
namespace | ut |
This file contains a set of libraries providing overloads for regular dynamic allocation routines which allow for opt-in memory instrumentation through performance schema memory engine (PFS). | |
Functions | |
static void | ut_pair_min (ulint *min_hi, ulint *min_lo, ulint a_hi, ulint a_lo, ulint b_hi, ulint b_lo) |
Calculate the minimum of two pairs. More... | |
static int | ut_ulint_cmp (ulint a, ulint b) |
Compares two ulints. More... | |
static int | ut_pair_cmp (ulint a_h, ulint a_l, ulint b_h, ulint b_l) |
Compare two pairs of integers. More... | |
constexpr ulint | ut_2_log (ulint n) |
Calculates fast the 2-logarithm of a number, rounded upward to an integer. More... | |
static uint32_t | ut_2_exp (uint32_t n) |
Calculates 2 to power n. More... | |
template<typename TCondition > | |
bool | ut::wait_for (TCondition cond, std::chrono::steady_clock::duration max_wait) |
Delays execution for at most max_wait or returns earlier if cond becomes true. More... | |
template<typename Condition > | |
static Wait_stats | ut::wait_for (uint64_t spins_limit, std::chrono::microseconds sleep, Condition condition={}) |
Waits in loop until given condition is satisfied. More... | |
Various utilities.
Created 5/30/1994 Heikki Tuuri
|
inlinestatic |
Calculates 2 to power n.
[in] | n | power of 2 |
Calculates fast the 2-logarithm of a number, rounded upward to an integer.
n | in: number != 0 |
Compare two pairs of integers.
[in] | a_h | more significant part of first pair |
[in] | a_l | less significant part of first pair |
[in] | b_h | more significant part of second pair |
[in] | b_l | less significant part of second pair |
-1 | if (a_h,a_l) is less than (b_h,b_l) |
0 | if (a_h,a_l) is equal to (b_h,b_l) |
1 | if (a_h,a_l) is greater than (b_h,b_l) |
|
inlinestatic |
Calculate the minimum of two pairs.
[out] | min_hi | MSB of the minimum pair |
[out] | min_lo | LSB of the minimum pair |
[in] | a_hi | MSB of the first pair |
[in] | a_lo | LSB of the first pair |
[in] | b_hi | MSB of the second pair |
[in] | b_lo | LSB of the second pair |