InnoDB Plugin
1.0
|
Go to the source code of this file.
Macros | |
#define | UT_END_OF_FIELD 257 |
Functions | |
UNIV_INLINE void | ut_rnd_set_seed (ulint seed) |
UNIV_INLINE ulint | ut_rnd_gen_next_ulint (ulint rnd) |
UNIV_INLINE ulint | ut_rnd_gen_ulint (void) |
UNIV_INLINE ulint | ut_rnd_interval (ulint low, ulint high) |
UNIV_INLINE ibool | ut_rnd_gen_ibool (void) |
UNIV_INLINE ulint | ut_hash_ulint (ulint key, ulint table_size) |
UNIV_INLINE ulint | ut_fold_ull (ib_uint64_t d)) |
UNIV_INLINE ulint | ut_fold_string (const char *str)) |
UNIV_INTERN ulint | ut_find_prime (ulint n)) |
UNIV_INLINE ulint | ut_fold_ulint_pair (ulint n1, ulint n2)) |
UNIV_INLINE ulint | ut_fold_binary (const byte *str, ulint len)) |
Random numbers and hashing
Created 1/20/1994 Heikki Tuuri
#define UT_END_OF_FIELD 257 |
The 'character code' for end of field or string (used
in folding records
UNIV_INTERN ulint ut_find_prime | ( | ulint | n | ) |
Looks for a prime number slightly greater than the given argument. The prime is chosen so that it is not near any power of 2.
n | in: positive number > 100 |
UNIV_INLINE ulint ut_fold_binary | ( | const byte * | str, |
ulint | len | ||
) |
Folds a binary string.
str | in: string of bytes |
len | in: length |
UNIV_INLINE ulint ut_fold_string | ( | const char * | str | ) |
Folds a character string ending in the null character.
str | in: null-terminated string |
UNIV_INLINE ulint ut_fold_ulint_pair | ( | ulint | n1, |
ulint | n2 | ||
) |
Folds a pair of ulints.
n1 | in: ulint |
n2 | in: ulint |
UNIV_INLINE ulint ut_fold_ull | ( | ib_uint64_t | d | ) |
Folds a 64-bit integer.
d | in: 64-bit integer |
UNIV_INLINE ulint ut_hash_ulint | ( | ulint | key, |
ulint | table_size | ||
) |
The following function generates a hash value for a ulint integer to a hash table of size table_size, which should be a prime or some random number to work reliably.
The following function generates a hash value for a ulint integer to a hash table of size table_size, which should be a prime or some random number for the hash table to work reliably.
key | in: value to be hashed |
table_size | in: hash table size |
UNIV_INLINE ibool ut_rnd_gen_ibool | ( | void | ) |
Generates a random iboolean value.
UNIV_INLINE ulint ut_rnd_gen_next_ulint | ( | ulint | rnd | ) |
The following function generates a series of 'random' ulint integers.
The following function generates a series of 'random' ulint integers.
rnd | in: the previous random number value |
UNIV_INLINE ulint ut_rnd_gen_ulint | ( | void | ) |
The following function generates 'random' ulint integers which enumerate the value space (let there be N of them) of ulint integers in a pseudo-random fashion. Note that the same integer is repeated always after N calls to the generator.
The following function generates 'random' ulint integers which enumerate the value space of ulint integers in a pseudo random fashion. Note that the same integer is repeated always after 2 to power 32 calls to the generator (if ulint is 32-bit).
UNIV_INLINE ulint ut_rnd_interval | ( | ulint | low, |
ulint | high | ||
) |
Generates a random integer from a given interval.
Generates a random integer from a given interval.
low | in: low limit; can generate also this value |
high | in: high limit; can generate also this value |
UNIV_INLINE void ut_rnd_set_seed | ( | ulint | seed | ) |
This is used to set the random number seed. in: seed
This is used to set the random number seed.
seed | in: seed |