#include "univ.i"#include "ut0byte.h"Include dependency graph for ut0rnd.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Defines | |
| #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_ulint_pair (ulint n1, ulint n2) |
| UNIV_INLINE ulint | ut_fold_dulint (dulint d) |
| UNIV_INLINE ulint | ut_fold_string (const char *str) |
| UNIV_INLINE ulint | ut_fold_binary (const byte *str, ulint len) |
| ulint | ut_find_prime (ulint n) |
Definition at line 28 of file ut0rnd.c.
References UT_RANDOM_1, UT_RANDOM_2, and UT_RANDOM_3.
Referenced by hash_create().
00030 : prime */ 00031 ulint n) /* in: positive number > 100 */ 00032 { 00033 ulint pow2; 00034 ulint i; 00035 00036 n += 100; 00037 00038 pow2 = 1; 00039 while (pow2 * 2 < n) { 00040 pow2 = 2 * pow2; 00041 } 00042 00043 if ((double)n < 1.05 * (double)pow2) { 00044 n = (ulint) ((double)n * UT_RANDOM_1); 00045 } 00046 00047 pow2 = 2 * pow2; 00048 00049 if ((double)n > 0.95 * (double)pow2) { 00050 n = (ulint) ((double)n * UT_RANDOM_2); 00051 } 00052 00053 if (n > pow2 - 20) { 00054 n += 30; 00055 } 00056 00057 /* Now we have n far enough from powers of 2. To make 00058 n more random (especially, if it was not near 00059 a power of 2), we then multiply it by a random number. */ 00060 00061 n = (ulint) ((double)n * UT_RANDOM_3); 00062 00063 for (;; n++) { 00064 i = 2; 00065 while (i * i <= n) { 00066 if (n % i == 0) { 00067 goto next_n; 00068 } 00069 i++; 00070 } 00071 00072 /* Found a prime */ 00073 break; 00074 next_n: ; 00075 } 00076 00077 return(n); 00078 }
Here is the caller graph for this function:

Referenced by dict_table_add_to_cache(), dict_table_change_id_in_cache(), and dict_table_remove_from_cache().
Here is the caller graph for this function:

| UNIV_INLINE ulint ut_fold_string | ( | const char * | str | ) |
Referenced by dict_col_add_to_cache(), dict_col_remove_from_cache(), dict_col_reposition_in_cache(), dict_index_find_cols(), dict_table_add_to_cache(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), fil_get_space_id_for_table(), fil_rename_tablespace_in_mem(), fil_space_create(), fil_space_for_table_exists_in_mem(), and fil_space_free().
Here is the caller graph for this function:

Definition at line 68 of file innochecksum.c.
References UT_HASH_RANDOM_MASK, and UT_HASH_RANDOM_MASK2.
Referenced by dict_col_add_to_cache(), dict_col_remove_from_cache(), dict_col_reposition_in_cache(), dict_index_find_cols(), recv_fold(), and ut_fold_binary().
00070 : folded value */ 00071 ulint n1, /* in: ulint */ 00072 ulint n2) /* in: ulint */ 00073 { 00074 return(((((n1 ^ n2 ^ UT_HASH_RANDOM_MASK2) << 8) + n1) 00075 ^ UT_HASH_RANDOM_MASK) + n2); 00076 }
Here is the caller graph for this function:

| UNIV_INLINE ibool ut_rnd_gen_ibool | ( | void | ) |
| UNIV_INLINE ulint ut_rnd_gen_ulint | ( | void | ) |
Referenced by mutex_spin_wait(), rw_lock_s_lock_spin(), and rw_lock_x_lock_func().
Here is the caller graph for this function:

| UNIV_INLINE void ut_rnd_set_seed | ( | ulint | seed | ) |
1.4.7

