#include "hash0hash.h"#include "mem0mem.h"Include dependency graph for hash0hash.c:

Go to the source code of this file.
Functions | |
| void | hash_mutex_enter (hash_table_t *table, ulint fold) |
| void | hash_mutex_exit (hash_table_t *table, ulint fold) |
| void | hash_mutex_enter_all (hash_table_t *table) |
| void | hash_mutex_exit_all (hash_table_t *table) |
| hash_table_t * | hash_create (ulint n) |
| void | hash_table_free (hash_table_t *table) |
| void | hash_create_mutexes (hash_table_t *table, ulint n_mutexes, ulint sync_level) |
| hash_table_t* hash_create | ( | ulint | n | ) |
Definition at line 77 of file hash0hash.c.
References hash_table_struct::adaptive, hash_table_struct::array, FALSE, hash_get_nth_cell(), HASH_TABLE_MAGIC_N, hash_table_struct::heap, hash_table_struct::heaps, hash_table_struct::magic_n, mem_alloc, hash_table_struct::mutexes, hash_table_struct::n_cells, hash_table_struct::n_mutexes, hash_cell_struct::node, NULL, ut_find_prime(), and ut_malloc().
Referenced by buf_pool_init(), dict_init(), fil_system_create(), ha_create(), lock_sys_create(), recv_sys_empty_hash(), recv_sys_init(), and thr_local_init().
00079 : created table */ 00080 ulint n) /* in: number of array cells */ 00081 { 00082 hash_cell_t* array; 00083 ulint prime; 00084 hash_table_t* table; 00085 ulint i; 00086 hash_cell_t* cell; 00087 00088 prime = ut_find_prime(n); 00089 00090 table = mem_alloc(sizeof(hash_table_t)); 00091 00092 array = ut_malloc(sizeof(hash_cell_t) * prime); 00093 00094 table->adaptive = FALSE; 00095 table->array = array; 00096 table->n_cells = prime; 00097 table->n_mutexes = 0; 00098 table->mutexes = NULL; 00099 table->heaps = NULL; 00100 table->heap = NULL; 00101 table->magic_n = HASH_TABLE_MAGIC_N; 00102 00103 /* Initialize the cell array */ 00104 00105 for (i = 0; i < prime; i++) { 00106 00107 cell = hash_get_nth_cell(table, i); 00108 cell->node = NULL; 00109 } 00110 00111 return(table); 00112 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void hash_create_mutexes | ( | hash_table_t * | table, | |
| ulint | n_mutexes, | |||
| ulint | sync_level | |||
| ) |
Definition at line 132 of file hash0hash.c.
References mem_alloc, mutex_create, hash_table_struct::mutexes, hash_table_struct::n_mutexes, ut_2_power_up(), and ut_a.
Referenced by ha_create().
00134 : hash table */ 00135 ulint n_mutexes, /* in: number of mutexes, must be a 00136 power of 2 */ 00137 ulint sync_level) /* in: latching order level of the 00138 mutexes: used in the debug version */ 00139 { 00140 ulint i; 00141 00142 ut_a(n_mutexes == ut_2_power_up(n_mutexes)); 00143 00144 table->mutexes = mem_alloc(n_mutexes * sizeof(mutex_t)); 00145 00146 for (i = 0; i < n_mutexes; i++) { 00147 mutex_create(table->mutexes + i, sync_level); 00148 } 00149 00150 table->n_mutexes = n_mutexes; 00151 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void hash_mutex_enter | ( | hash_table_t * | table, | |
| ulint | fold | |||
| ) |
Definition at line 20 of file hash0hash.c.
References hash_get_mutex(), and mutex_enter.
00022 : hash table */ 00023 ulint fold) /* in: fold */ 00024 { 00025 mutex_enter(hash_get_mutex(table, fold)); 00026 }
Here is the call graph for this function:

| void hash_mutex_enter_all | ( | hash_table_t * | table | ) |
Definition at line 44 of file hash0hash.c.
References mutex_enter, hash_table_struct::mutexes, and hash_table_struct::n_mutexes.
00046 : hash table */ 00047 { 00048 ulint i; 00049 00050 for (i = 0; i < table->n_mutexes; i++) { 00051 00052 mutex_enter(table->mutexes + i); 00053 } 00054 }
| void hash_mutex_exit | ( | hash_table_t * | table, | |
| ulint | fold | |||
| ) |
Definition at line 32 of file hash0hash.c.
References hash_get_mutex(), and mutex_exit().
00034 : hash table */ 00035 ulint fold) /* in: fold */ 00036 { 00037 mutex_exit(hash_get_mutex(table, fold)); 00038 }
Here is the call graph for this function:

| void hash_mutex_exit_all | ( | hash_table_t * | table | ) |
Definition at line 60 of file hash0hash.c.
References mutex_exit(), hash_table_struct::mutexes, and hash_table_struct::n_mutexes.
00062 : hash table */ 00063 { 00064 ulint i; 00065 00066 for (i = 0; i < table->n_mutexes; i++) { 00067 00068 mutex_exit(table->mutexes + i); 00069 } 00070 }
Here is the call graph for this function:

| void hash_table_free | ( | hash_table_t * | table | ) |
Definition at line 118 of file hash0hash.c.
References hash_table_struct::array, mem_free, hash_table_struct::mutexes, NULL, ut_a, and ut_free().
Referenced by recv_sys_empty_hash(), and recv_sys_free().
00120 : hash table */ 00121 { 00122 ut_a(table->mutexes == NULL); 00123 00124 ut_free(table->array); 00125 mem_free(table); 00126 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.4.7

