#include "univ.i"
Go to the source code of this file.
Defines | |
#define | UT_LIST_BASE_NODE_T(TYPE) int |
#define | UT_LIST_NODE_T(TYPE) |
#define | UT_LIST_INIT(BASE) |
#define | UT_LIST_ADD_FIRST(NAME, BASE, N) |
#define | UT_LIST_ADD_LAST(NAME, BASE, N) |
#define | UT_LIST_INSERT_AFTER(NAME, BASE, NODE1, NODE2) |
#define | UT_LIST_REMOVE_CLEAR(NAME, N) |
#define | UT_LIST_REMOVE(NAME, BASE, N) |
#define | UT_LIST_GET_NEXT(NAME, N) (((N)->NAME).next) |
#define | UT_LIST_GET_PREV(NAME, N) (((N)->NAME).prev) |
#define | UT_LIST_GET_LEN(BASE) (BASE).count |
#define | UT_LIST_GET_FIRST(BASE) (BASE).start |
#define | UT_LIST_GET_LAST(BASE) (BASE= NULL) |
#define | UT_LIST_VALIDATE(NAME, TYPE, BASE, ASSERTION) |
#define UT_LIST_ADD_FIRST | ( | NAME, | |
BASE, | |||
N | |||
) |
{\ ut_ad(N);\ ((BASE).count)++;\ ((N)->NAME).next = (BASE).start;\ ((N)->NAME).prev = NULL;\ if (UNIV_LIKELY((BASE).start != NULL)) {\ ut_ad((BASE).start != (N));\ (((BASE).start)->NAME).prev = (N);\ }\ (BASE).start = (N);\ if (UNIV_UNLIKELY((BASE).end == NULL)) {\ (BASE).end = (N);\ }\ }\
Adds the node as the first element in a two-way linked list.
NAME | list name |
BASE | the base node (not a pointer to it) |
N | pointer to the node to be added to the list. |
Definition at line 96 of file ut0lst.h.
Referenced by buf_flush_relocate_on_flush_list(), buf_LRU_block_free_non_file_page(), buf_LRU_insert_zip_clean(), buf_relocate(), buf_unzip_LRU_add_block(), dict_table_add_to_cache(), mem_area_free(), mem_pool_create(), mutex_create_func(), os_event_create(), os_mutex_create(), que_thr_stop(), read_cursor_view_create_for_mysql(), read_view_open_now(), rw_lock_create_func(), trx_allocate_for_mysql(), trx_start_low(), trx_undo_assign_undo(), trx_undo_insert_cleanup(), trx_undo_update_cleanup(), and ut_malloc_low().
#define UT_LIST_ADD_LAST | ( | NAME, | |
BASE, | |||
N | |||
) |
{\ ut_ad(N != NULL);\ ((BASE).count)++;\ ((N)->NAME).prev = (BASE).end;\ ((N)->NAME).next = NULL;\ if ((BASE).end != NULL) {\ ut_ad((BASE).end != (N));\ (((BASE).end)->NAME).next = (N);\ }\ (BASE).end = (N);\ if ((BASE).start == NULL) {\ (BASE).start = (N);\ }\ }\
Adds the node as the last element in a two-way linked list.
NAME | list name |
BASE | the base node (not a pointer to it) |
N | pointer to the node to be added to the list |
Definition at line 118 of file ut0lst.h.
Referenced by buf_unzip_LRU_add_block(), dict_foreign_add_to_cache(), dict_index_add_to_cache(), fil_node_create(), fil_space_create(), ins_node_create_entry_list(), lock_move_reorganize_page(), log_group_init(), opt_find_all_cols(), que_graph_publish(), que_thr_create(), read_view_oldest_copy_or_open_new(), srv_conc_enter_innodb(), srv_que_task_enqueue_low(), sym_tab_add_bound_id(), sym_tab_add_bound_lit(), sym_tab_add_id(), sym_tab_add_int_lit(), sym_tab_add_null_lit(), sym_tab_add_str_lit(), trx_savepoint_for_mysql(), and trx_sig_send().
#define UT_LIST_BASE_NODE_T | ( | TYPE | ) | int |
This macro expands to the unnamed type definition of a struct which acts as the two-way list base node. The base node contains pointers to both ends of the list and a count of nodes in the list (excluding the base node from the count).
TYPE | the name of the list node data type |
#define UT_LIST_GET_FIRST | ( | BASE | ) | (BASE).start |
Gets the first node in a two-way list.
BASE | the base node (not a pointer to it) |
Definition at line 223 of file ut0lst.h.
Referenced by buf_LRU_get_free_only(), ha_innobase::can_switch_engines(), dict_check_tablespaces_and_store_max_id(), dict_create_add_foreigns_to_dictionary(), dict_foreign_parse_drop_constraints(), dict_get_first_table_name_in_db(), dict_index_find_on_id_low(), dict_load_table(), dict_print_info_on_foreign_keys(), dict_startscan_system(), dict_table_get_foreign_constraint(), dict_table_get_referenced_constraint(), dict_table_print_low(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), dict_table_replace_index_in_foreign_list(), dict_truncate_index_tree(), fil_close_all_files(), fil_delete_tablespace(), fil_flush(), fil_flush_file_spaces(), fil_io(), fil_open_log_and_system_tablespace_files(), fil_rename_tablespace(), fil_space_get_flags(), fil_space_get_size(), fil_validate(), fil_write_flushed_lsn_to_data_files(), ha_innobase::get_foreign_key_list(), innodb_mutex_show_status(), lock_get_src_table(), lock_is_table_exclusive(), lock_move_reorganize_page(), lock_number_of_rows_locked(), lock_print_info_all_transactions(), lock_remove_all_on_table(), log_groups_write_checkpoint_info(), log_write_up_to(), logs_empty_and_mark_files_at_shutdown(), mem_area_alloc(), mem_pool_validate(), mutex_create_func(), mutex_free_func(), opt_find_all_cols(), os_sync_free(), pars_sql(), que_fork_error_handle(), que_fork_start_command(), que_graph_free_recursive(), read_cursor_view_create_for_mysql(), read_view_open_now(), recv_recover_page_func(), recv_recovery_from_checkpoint_start_func(), recv_reset_logs(), row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), row_drop_tables_for_mysql_in_background(), row_ins_index_entry(), row_sel_step(), row_truncate_table_for_mysql(), rw_lock_create_func(), srv_conc_enter_innodb(), srv_conc_force_exit_innodb(), sym_tab_free_private(), sync_close(), trx_end_lock_wait(), trx_finish_rollback_off_kernel(), trx_get_trx_by_xid(), trx_in_trx_list(), trx_lists_init_at_db_start(), trx_recover_for_mysql(), trx_release_savepoint_for_mysql(), trx_roll_savepoints_free(), trx_rollback_or_clean_recovered(), trx_rollback_to_savepoint_for_mysql(), trx_rseg_get_on_id(), trx_rseg_mem_free(), trx_savepoint_for_mysql(), trx_sig_send(), trx_sig_start_handle(), trx_sys_close(), trx_sys_init_at_db_start(), and ut_free_all_mem().
#define UT_LIST_GET_LAST | ( | BASE | ) | (BASE= NULL) |
Gets the last node in a two-way list.
BASE | the base node (not a pointer to it) |
Definition at line 234 of file ut0lst.h.
Referenced by buf_pool_get_oldest_modification(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), fil_extend_space_to_desired_size(), lock_release_off_kernel(), read_view_oldest_copy_or_open_new(), and trx_purge().
#define UT_LIST_GET_LEN | ( | BASE | ) | (BASE).count |
Alternative macro to get the number of nodes in a two-way list, i.e., its length.
BASE | the base node (not a pointer to it). |
Definition at line 216 of file ut0lst.h.
Referenced by buf_get_total_list_len(), buf_LRU_buf_pool_running_out(), buf_LRU_free_block(), buf_LRU_get_free_block(), dict_create_or_check_foreign_constraint_tables(), dict_index_add_to_cache(), dict_table_is_referenced_by_foreign_key(), dict_table_print_low(), fil_close(), fil_delete_tablespace(), fil_flush_file_spaces(), fil_rename_tablespace(), fil_space_get_flags(), fil_space_get_size(), ha_print_info(), ha_innobase::info(), innobase_build_index_translation(), lock_get_src_table(), logs_empty_and_mark_files_at_shutdown(), mem_area_alloc(), mem_pool_print_info(), mutex_create_func(), mutex_free_func(), opt_print_query_plan(), que_fork_error_handle(), que_thr_stop(), read_cursor_view_create_for_mysql(), read_view_open_now(), row_drop_tables_for_mysql_in_background(), row_get_background_drop_list_len_low(), row_search_check_if_query_cache_permitted(), sess_close(), srv_printf_innodb_monitor(), trx_commit_off_kernel(), trx_free(), trx_print(), trx_roll_savepoint_free(), trx_rseg_mem_free(), trx_sig_send(), trx_sig_start_handle(), trx_sys_close(), trx_sys_init_at_db_start(), and trx_weight_ge().
#define UT_LIST_GET_NEXT | ( | NAME, | |
N | |||
) | (((N)->NAME).next) |
Gets the next node in a two-way list.
NAME | list name |
N | pointer to a node |
Definition at line 200 of file ut0lst.h.
Referenced by buf_LRU_free_block(), buf_LRU_insert_zip_clean(), buf_relocate(), dict_create_add_foreigns_to_dictionary(), dict_foreign_parse_drop_constraints(), dict_index_find_on_id_low(), dict_print_info_on_foreign_keys(), dict_table_get_foreign_constraint(), dict_table_get_referenced_constraint(), dict_table_print_low(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), dict_table_replace_index_in_foreign_list(), dict_truncate_index_tree(), fil_close_all_files(), fil_flush(), fil_flush_file_spaces(), fil_io(), fil_open_log_and_system_tablespace_files(), fil_validate(), fil_write_flushed_lsn_to_data_files(), ha_innobase::get_foreign_key_list(), innodb_mutex_show_status(), lock_get_src_table(), lock_is_table_exclusive(), lock_move_reorganize_page(), lock_number_of_rows_locked(), lock_print_info_all_transactions(), lock_remove_all_on_table(), log_groups_write_checkpoint_info(), log_write_up_to(), mem_pool_validate(), mutex_free_func(), opt_find_all_cols(), pars_sql(), que_fork_error_handle(), que_fork_start_command(), que_graph_free_recursive(), read_cursor_view_create_for_mysql(), read_view_open_now(), recv_recover_page_func(), recv_recovery_from_checkpoint_start_func(), recv_reset_logs(), row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), row_truncate_table_for_mysql(), rw_lock_free_func(), srv_conc_force_exit_innodb(), sym_tab_free_private(), sync_close(), trx_finish_rollback_off_kernel(), trx_get_trx_by_xid(), trx_in_trx_list(), trx_lists_init_at_db_start(), trx_recover_for_mysql(), trx_release_savepoint_for_mysql(), trx_roll_savepoints_free(), trx_rollback_or_clean_recovered(), trx_rollback_to_savepoint_for_mysql(), trx_rseg_get_on_id(), trx_rseg_mem_free(), trx_savepoint_for_mysql(), trx_sys_close(), and trx_sys_init_at_db_start().
#define UT_LIST_GET_PREV | ( | NAME, | |
N | |||
) | (((N)->NAME).prev) |
Gets the previous node in a two-way list.
NAME | list name |
N | pointer to a node |
Definition at line 208 of file ut0lst.h.
Referenced by buf_flush_relocate_on_flush_list(), buf_LRU_free_block(), buf_LRU_insert_zip_clean(), buf_relocate(), lock_queue_iterator_get_prev(), lock_remove_all_on_table(), mutex_free_func(), and rw_lock_free_func().
#define UT_LIST_INIT | ( | BASE | ) |
{\ (BASE).count = 0;\ (BASE).start = NULL;\ (BASE).end = NULL;\ }\
Initializes the base node of a two-way list.
BASE | the list base node |
Definition at line 83 of file ut0lst.h.
Referenced by dict_init(), dict_table_rename_in_cache(), fil_init(), fil_space_create(), ins_node_create_entry_list(), lock_move_reorganize_page(), log_init(), mem_init(), mem_pool_create(), os_sync_init(), pars_select_statement(), pars_update_statement(), que_fork_create(), row_create_update_node_for_mysql(), row_drop_tables_for_mysql_in_background(), row_get_background_drop_list_len_low(), rw_lock_create_func(), sess_open(), srv_init(), sym_tab_create(), sync_init(), trx_create(), trx_lists_init_at_db_start(), trx_rseg_list_and_array_init(), trx_sys_init_at_db_start(), trx_undo_lists_init(), and ut_mem_init().
#define UT_LIST_INSERT_AFTER | ( | NAME, | |
BASE, | |||
NODE1, | |||
NODE2 | |||
) |
{\ ut_ad(NODE1);\ ut_ad(NODE2);\ ut_ad((NODE1) != (NODE2));\ ((BASE).count)++;\ ((NODE2)->NAME).prev = (NODE1);\ ((NODE2)->NAME).next = ((NODE1)->NAME).next;\ if (((NODE1)->NAME).next != NULL) {\ ((((NODE1)->NAME).next)->NAME).prev = (NODE2);\ }\ ((NODE1)->NAME).next = (NODE2);\ if ((BASE).end == (NODE1)) {\ (BASE).end = (NODE2);\ }\ }\
Inserts a NODE2 after NODE1 in a list.
NAME | list name |
BASE | the base node (not a pointer to it) |
NODE1 | pointer to node after which NODE2 is inserted |
NODE2 | pointer to node being inserted after NODE1 |
Definition at line 141 of file ut0lst.h.
Referenced by buf_flush_relocate_on_flush_list(), buf_LRU_free_block(), buf_LRU_insert_zip_clean(), and buf_relocate().
#define UT_LIST_NODE_T | ( | TYPE | ) |
struct {\
TYPE * prev; \
TYPE * next; \
}\
This macro expands to the unnamed type definition of a struct which should be embedded in the nodes of the list, the node type must be a struct. This struct contains the pointers to next and previous nodes in the list. The name of the field in the node struct should be the name given to the list.
TYPE | the list node type name |
#define UT_LIST_REMOVE | ( | NAME, | |
BASE, | |||
N | |||
) |
do { \ ut_ad(N); \ ut_a((BASE).count > 0); \ ((BASE).count)--; \ if (((N)->NAME).next != NULL) { \ ((((N)->NAME).next)->NAME).prev = ((N)->NAME).prev; \ } else { \ (BASE).end = ((N)->NAME).prev; \ } \ if (((N)->NAME).prev != NULL) { \ ((((N)->NAME).prev)->NAME).next = ((N)->NAME).next; \ } else { \ (BASE).start = ((N)->NAME).next; \ } \ UT_LIST_REMOVE_CLEAR(NAME, N); \ } while (0)
Removes a node from a two-way linked list.
NAME | list name |
BASE | the base node (not a pointer to it) |
N | pointer to the node to be removed from the list |
Definition at line 177 of file ut0lst.h.
Referenced by buf_flush_relocate_on_flush_list(), buf_flush_remove(), buf_LRU_get_free_only(), buf_page_get_gen(), buf_relocate(), dict_foreign_add_to_cache(), dict_index_remove_from_cache(), dict_table_remove_from_cache(), fil_flush(), mem_area_alloc(), mem_area_free(), mutex_free_func(), os_event_free(), os_mutex_free(), read_view_close(), row_drop_tables_for_mysql_in_background(), rw_lock_free_func(), srv_conc_enter_innodb(), trx_cleanup_at_db_startup(), trx_commit_off_kernel(), trx_end_lock_wait(), trx_free_for_mysql(), trx_roll_savepoint_free(), trx_rseg_mem_free(), trx_savepoint_for_mysql(), trx_sig_remove(), trx_sig_reply(), trx_sys_close(), trx_undo_insert_cleanup(), trx_undo_update_cleanup(), ut_free(), and ut_free_all_mem().
#define UT_LIST_REMOVE_CLEAR | ( | NAME, | |
N | |||
) |
#define UT_LIST_VALIDATE | ( | NAME, | |
TYPE, | |||
BASE, | |||
ASSERTION | |||
) |
do { \ ulint ut_list_i_313; \ TYPE* ut_list_node_313; \ \ ut_list_node_313 = (BASE).start; \ \ for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) { \ ut_a(ut_list_node_313); \ ASSERTION; \ ut_ad((ut_list_node_313->NAME).next || !ut_list_i_313); \ ut_list_node_313 = (ut_list_node_313->NAME).next; \ } \ \ ut_a(ut_list_node_313 == NULL); \ \ ut_list_node_313 = (BASE).end; \ \ for (ut_list_i_313 = (BASE).count; ut_list_i_313--; ) { \ ut_a(ut_list_node_313); \ ASSERTION; \ ut_ad((ut_list_node_313->NAME).prev || !ut_list_i_313); \ ut_list_node_313 = (ut_list_node_313->NAME).prev; \ } \ \ ut_a(ut_list_node_313 == NULL); \ } while (0)
Checks the consistency of a two-way list.
NAME | the name of the list |
TYPE | node type |
BASE | base node (not a pointer to it) |
ASSERTION | a condition on ut_list_node_313 |
Definition at line 243 of file ut0lst.h.
Referenced by buf_relocate(), fil_validate(), and mem_pool_validate().