The world's most popular open source database
#include "univ.i"#include "ut0mem.h"#include "ut0byte.h"#include "ut0ut.h"#include "ut0rnd.h"#include "sync0sync.h"#include "ut0lst.h"#include "mach0data.h"#include "mem0dbg.h"Include dependency graph for mem0mem.h:

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

Go to the source code of this file.
Classes | |
| struct | mem_block_info_struct |
Defines | |
| #define | MEM_HEAP_DYNAMIC 0 |
| #define | MEM_HEAP_BUFFER 1 |
| #define | MEM_HEAP_BTR_SEARCH 2 |
| #define | MEM_BLOCK_START_SIZE 64 |
| #define | MEM_BLOCK_STANDARD_SIZE 8000 |
| #define | MEM_MAX_ALLOC_IN_BUF (UNIV_PAGE_SIZE - 200) |
| #define | mem_heap_create(N) |
| #define | mem_heap_create_in_buffer(N) |
| #define | mem_heap_create_in_btr_search(N) |
| #define | mem_heap_fast_create(N, B) |
| #define | mem_heap_free(heap) |
| #define | mem_alloc(N) mem_alloc_func((N), __FILE__, __LINE__) |
| #define | mem_alloc_noninline(N) |
| #define | mem_free(PTR) mem_free_func((PTR), __FILE__, __LINE__) |
| #define | MEM_BLOCK_MAGIC_N 764741555 |
| #define | MEM_FREED_BLOCK_MAGIC_N 547711122 |
| #define | MEM_BLOCK_HEADER_SIZE |
Typedefs | |
| typedef mem_block_info_struct | mem_block_info_t |
| typedef mem_block_info_t | mem_block_t |
| typedef mem_block_t | mem_heap_t |
Functions | |
| void | mem_init (ulint size) |
| UNIV_INLINE mem_heap_t * | mem_heap_create_func (ulint n, void *init_block, ulint type, const char *file_name, ulint line) |
| UNIV_INLINE void | mem_heap_free_func (mem_heap_t *heap, const char *file_name, ulint line) |
| UNIV_INLINE void * | mem_heap_alloc (mem_heap_t *heap, ulint n) |
| UNIV_INLINE byte * | mem_heap_get_heap_top (mem_heap_t *heap) |
| UNIV_INLINE void | mem_heap_free_heap_top (mem_heap_t *heap, byte *old_top) |
| UNIV_INLINE void | mem_heap_empty (mem_heap_t *heap) |
| UNIV_INLINE void * | mem_heap_get_top (mem_heap_t *heap, ulint n) |
| UNIV_INLINE void | mem_heap_free_top (mem_heap_t *heap, ulint n) |
| UNIV_INLINE ulint | mem_heap_get_size (mem_heap_t *heap) |
| UNIV_INLINE void * | mem_alloc_func (ulint n, const char *file_name, ulint line) |
| void * | mem_alloc_func_noninline (ulint n, const char *file_name, ulint line) |
| UNIV_INLINE void | mem_free_func (void *ptr, const char *file_name, ulint line) |
| UNIV_INLINE char * | mem_strdup (const char *str) |
| UNIV_INLINE char * | mem_strdupl (const char *str, ulint len) |
| UNIV_INLINE char * | mem_strdupq (const char *str, char q) |
| char * | mem_heap_strdup (mem_heap_t *heap, const char *str) |
| UNIV_INLINE char * | mem_heap_strdupl (mem_heap_t *heap, const char *str, ulint len) |
| char * | mem_heap_strcat (mem_heap_t *heap, const char *s1, const char *s2) |
| void * | mem_heap_dup (mem_heap_t *heap, const void *data, ulint len) |
| void * | mem_heap_cat (mem_heap_t *heap, const void *b1, ulint len1, const void *b2, ulint len2) |
| char * | mem_heap_printf (mem_heap_t *heap, const char *format,...) __attribute__((format(printf |
Definition at line 209 of file mem0mem.h.
Referenced by btr_estimate_number_of_different_key_vals(), btr_page_split_and_insert(), btr_pcur_copy_stored_position(), btr_pcur_create_for_mysql(), btr_search_build_page_hash_index(), btr_search_drop_page_hash_index(), btr_search_info_update_slow(), btr_search_sys_create(), buf_pool_init(), dict_init(), dict_strip_comments(), dict_tree_create(), eval_node_alloc_val_buf(), fil_create_directory_for_tablename(), fil_extend_space_to_desired_size(), fil_load_single_table_tablespace(), fil_load_single_table_tablespaces(), fil_make_ibd_name(), fil_node_create(), fil_space_create(), fil_system_create(), fil_write_lsn_and_arch_no_to_file(), ha_create(), hash_create(), hash_create_mutexes(), ib_list_create(), ib_wqueue_create(), ibuf_data_init_for_space(), ibuf_init_at_db_start(), innobase_start_or_create_for_mysql(), lock_sys_create(), log_check_log_recs(), log_group_init(), log_init(), page_cur_parse_insert_rec(), rec_copy_prefix_to_buf(), rec_copy_prefix_to_buf_old(), recv_recover_page(), recv_sys_create(), recv_sys_init(), row_add_table_to_background_drop_list(), row_purge_remove_sec_if_poss_low(), row_scan_and_check_index(), row_sel_push_cache_row_for_mysql(), sel_col_prefetch_buf_alloc(), sess_open(), srv_init(), thr_local_create(), trx_create(), trx_doublewrite_init(), trx_purge_sys_create(), trx_rseg_mem_create(), trx_savepoint_for_mysql(), trx_sig_send(), trx_sys_init_at_db_start(), trx_undo_mem_create(), trx_undo_prev_version_build(), and ut_strreplace().
| #define mem_alloc_noninline | ( | N | ) |
| #define MEM_BLOCK_HEADER_SIZE |
Value:
ut_calc_align(sizeof(mem_block_info_t),\ UNIV_MEM_ALIGNMENT)
Definition at line 415 of file mem0mem.h.
Referenced by mem_heap_create_block().
| #define MEM_BLOCK_MAGIC_N 764741555 |
Definition at line 411 of file mem0mem.h.
Referenced by mem_analyze_corruption(), mem_heap_block_free(), mem_heap_check(), mem_heap_create_block(), and mem_heap_validate_or_print().
| #define MEM_BLOCK_STANDARD_SIZE 8000 |
| #define MEM_BLOCK_START_SIZE 64 |
| #define mem_free | ( | PTR | ) | mem_free_func((PTR), __FILE__, __LINE__) |
Definition at line 248 of file mem0mem.h.
Referenced by btr_estimate_number_of_different_key_vals(), btr_page_split_and_insert(), btr_pcur_copy_stored_position(), btr_pcur_free_for_mysql(), btr_search_build_page_hash_index(), btr_search_drop_page_hash_index(), btr_search_info_update_slow(), dict_check_tablespaces_and_store_max_id(), dict_create_foreign_constraints(), dict_foreign_parse_drop_constraints(), dict_print(), dict_table_rename_in_cache(), dict_tree_free(), eval_node_alloc_val_buf(), eval_node_free_val_buf(), fil_create_directory_for_tablename(), fil_create_new_single_table_tablespace(), fil_delete_tablespace(), fil_extend_space_to_desired_size(), fil_get_space_id_for_table(), fil_load_single_table_tablespace(), fil_load_single_table_tablespaces(), fil_node_create(), fil_node_free(), fil_open_single_table_tablespace(), fil_rename_tablespace(), fil_rename_tablespace_in_mem(), fil_reset_too_high_lsns(), fil_space_for_table_exists_in_mem(), fil_space_free(), hash_table_free(), ib_list_free(), ib_wqueue_free(), innobase_shutdown_for_mysql(), log_check_log_recs(), os_file_create_subdirs_if_needed(), page_cur_parse_insert_rec(), rec_copy_prefix_to_buf(), rec_copy_prefix_to_buf_old(), recv_recover_page(), recv_sys_free(), row_drop_database_for_mysql(), row_drop_table_for_mysql(), row_drop_tables_for_mysql_in_background(), row_ins_invalidate_query_cache(), row_mysql_recover_tmp_table(), row_prebuilt_free(), row_purge_remove_sec_if_poss_low(), row_scan_and_check_index(), sel_col_prefetch_buf_free(), sess_close(), thr_local_free(), trx_free(), trx_release_savepoint_for_mysql(), trx_roll_savepoints_free(), trx_savepoint_for_mysql(), trx_sig_remove(), trx_undo_mem_free(), and trx_undo_prev_version_build().
| #define MEM_FREED_BLOCK_MAGIC_N 547711122 |
Definition at line 412 of file mem0mem.h.
Referenced by mem_analyze_corruption(), and mem_heap_block_free().
| #define MEM_HEAP_BTR_SEARCH 2 |
Definition at line 39 of file mem0mem.h.
Referenced by ha_insert_for_fold(), and mem_heap_create_block().
| #define MEM_HEAP_BUFFER 1 |
Definition at line 38 of file mem0mem.h.
Referenced by mem_heap_block_free(), mem_heap_create_block(), and mem_heap_validate_or_print().
| #define mem_heap_create | ( | N | ) |
Value:
mem_heap_create_func(\ (N), NULL, MEM_HEAP_DYNAMIC, __FILE__, __LINE__)
Definition at line 70 of file mem0mem.h.
Referenced by btr_attach_half_pages(), btr_cur_optimistic_update(), btr_cur_parse_update_in_place(), btr_cur_pessimistic_delete(), btr_cur_pessimistic_update(), btr_page_get_father_for_rec(), btr_page_split_and_insert(), btr_pcur_restore_position(), btr_root_raise_and_insert(), btr_validate_level(), dict_create_foreign_constraints(), dict_get_first_table_name_in_db(), dict_load_foreign(), dict_load_foreigns(), dict_load_sys_table(), dict_load_table(), dict_load_table_on_id(), dict_mem_foreign_create(), dict_mem_index_create(), dict_mem_table_create(), dtuple_convert_big_rec(), dtuple_create_for_mysql(), dyn_array_add_block(), ibuf_delete_for_discarded_space(), ibuf_insert_low(), ibuf_merge_or_delete_for_page(), ibuf_rec_get_volume(), ind_create_graph_create(), ins_node_create(), lock_move_reorganize_page(), page_create(), page_validate(), pars_info_create(), pars_sql(), read_cursor_view_create_for_mysql(), recv_sys_init(), row_create_index_for_mysql(), row_create_prebuilt(), row_create_table_for_mysql(), row_get_clust_rec(), row_ins_clust_index_entry_by_modify(), row_ins_foreign_check_on_constraint(), row_ins_sec_index_entry_by_modify(), row_purge_del_mark(), row_purge_node_create(), row_purge_upd_exist_or_extern(), row_rename_table_for_mysql(), row_scan_and_check_index(), row_sel_build_committed_vers_for_mysql(), row_sel_build_prev_vers(), row_sel_build_prev_vers_for_mysql(), row_sel_fetch_columns(), row_sel_store_mysql_rec(), row_truncate_table_for_mysql(), row_undo_mod_del_mark_sec(), row_undo_mod_del_unmark_sec_and_undo_update(), row_undo_mod_upd_del_sec(), row_undo_mod_upd_exist_sec(), row_undo_node_create(), row_upd_check_references_constraints(), row_upd_clust_rec_by_insert(), row_upd_sec_index_entry(), row_vers_build_for_consistent_read(), row_vers_build_for_semi_consistent_read(), row_vers_impl_x_locked_off_kernel(), row_vers_old_has_index_entry(), tab_create_graph_create(), trx_create(), trx_general_rollback_for_mysql(), trx_purge_graph_build(), trx_purge_sys_create(), trx_roll_graph_build(), trx_rollback_or_clean_all_without_sess(), trx_undo_arr_create(), and upd_node_create().
| #define mem_heap_create_in_btr_search | ( | N | ) |
Value:
mem_heap_create_func(\ (N), NULL, MEM_HEAP_BTR_SEARCH | MEM_HEAP_BUFFER,\ __FILE__, __LINE__)
Definition at line 82 of file mem0mem.h.
Referenced by ha_create().
| #define mem_heap_create_in_buffer | ( | N | ) |
Value:
mem_heap_create_func(\ (N), NULL, MEM_HEAP_BUFFER, __FILE__, __LINE__)
Definition at line 76 of file mem0mem.h.
Referenced by ha_create(), recv_sys_init(), and trx_create().
| #define MEM_HEAP_DYNAMIC 0 |
Definition at line 37 of file mem0mem.h.
Referenced by mem_heap_add_block(), mem_heap_block_free(), mem_heap_create_block(), and rec_get_offsets_func().
| #define mem_heap_fast_create | ( | N, | |||
| B | ) |
Value:
mem_heap_create_func(\ (N), (B), MEM_HEAP_DYNAMIC, __FILE__, __LINE__)
| #define mem_heap_free | ( | heap | ) |
Value:
mem_heap_free_func(\ (heap), __FILE__, __LINE__)
Definition at line 98 of file mem0mem.h.
Referenced by btr_attach_half_pages(), btr_compress(), btr_cur_del_mark_set_clust_rec(), btr_cur_open_at_index_side(), btr_cur_open_at_rnd_pos(), btr_cur_optimistic_delete(), btr_cur_optimistic_update(), btr_cur_parse_del_mark_set_clust_rec(), btr_cur_parse_update_in_place(), btr_cur_pessimistic_delete(), btr_cur_pessimistic_update(), btr_cur_search_to_nth_level(), btr_cur_upd_lock_and_undo(), btr_cur_update_in_place(), btr_estimate_number_of_different_key_vals(), btr_index_rec_validate(), btr_page_get_father_for_rec(), btr_page_get_sure_split_rec(), btr_page_split_and_insert(), btr_pcur_restore_position(), btr_root_raise_and_insert(), btr_search_build_page_hash_index(), btr_search_check_guess(), btr_search_drop_page_hash_index(), btr_search_update_hash_on_delete(), btr_search_update_hash_on_insert(), btr_search_update_hash_ref(), btr_search_validate(), btr_validate_level(), dict_create_foreign_constraints(), dict_foreign_add_to_cache(), dict_foreign_free(), dict_get_first_table_name_in_db(), dict_load_foreign(), dict_load_foreigns(), dict_load_sys_table(), dict_load_table(), dict_load_table_on_id(), dict_mem_index_free(), dict_mem_table_free(), dtuple_big_rec_free(), dtuple_convert_back_big_rec(), dtuple_convert_big_rec(), dtuple_free_for_mysql(), ibuf_delete_for_discarded_space(), ibuf_insert_low(), ibuf_merge_or_delete_for_page(), ibuf_rec_get_volume(), lock_clust_rec_read_check_and_lock_alt(), lock_move_reorganize_page(), lock_rec_insert_check_and_lock(), lock_rec_print(), lock_rec_validate_page(), lock_sec_rec_modify_check_and_lock(), page_copy_rec_list_end_no_locks(), page_copy_rec_list_end_to_created_page(), page_copy_rec_list_start(), page_create(), page_cur_insert_rec_low(), page_cur_insert_rec_write_log(), page_cur_parse_delete_rec(), page_cur_parse_insert_rec(), page_cur_search_with_match(), page_delete_rec_list_end(), page_delete_rec_list_start(), page_mem_alloc(), page_print_list(), page_validate(), pars_info_free(), que_graph_free(), que_graph_free_recursive(), read_cursor_view_close_for_mysql(), rec_convert_dtuple_to_rec(), rec_print(), recv_sys_free(), row_build_row_ref(), row_build_row_ref_in_tuple(), row_get_clust_rec(), row_ins_clust_index_entry_by_modify(), row_ins_duplicate_error_in_clust(), row_ins_index_entry_low(), row_ins_scan_sec_index_for_duplicate(), row_ins_sec_index_entry_by_modify(), row_mysql_prebuilt_free_blob_heap(), row_prebuilt_free(), row_purge_del_mark(), row_purge_remove_clust_if_poss_low(), row_purge_upd_exist_or_extern(), row_rec_to_index_entry(), row_rename_table_for_mysql(), row_scan_and_check_index(), row_search_for_mysql(), row_sel(), row_sel_fetch_columns(), row_sel_get_clust_rec(), row_sel_sec_rec_is_for_clust_rec(), row_sel_store_mysql_rec(), row_sel_try_search_shortcut(), row_truncate_table_for_mysql(), row_undo_mod_del_mark_sec(), row_undo_mod_del_unmark_sec_and_undo_update(), row_undo_mod_upd_del_sec(), row_undo_mod_upd_exist_sec(), row_undo_search_clust_to_pcur(), row_upd_check_references_constraints(), row_upd_clust_rec(), row_upd_clust_rec_by_insert(), row_upd_clust_step(), row_upd_in_place_in_select(), row_upd_sec_index_entry(), row_upd_store_row(), row_vers_build_for_consistent_read(), row_vers_build_for_semi_consistent_read(), row_vers_impl_x_locked_off_kernel(), row_vers_old_has_index_entry(), sel_node_free_private(), trx_free(), trx_general_rollback_for_mysql(), trx_rollback_or_clean_all_without_sess(), trx_undo_arr_free(), and trx_undo_report_row_operation().
| #define MEM_MAX_ALLOC_IN_BUF (UNIV_PAGE_SIZE - 200) |
Definition at line 57 of file mem0mem.h.
Referenced by mem_heap_add_block(), and mem_heap_create_block().
| typedef struct mem_block_info_struct mem_block_info_t |
| typedef mem_block_info_t mem_block_t |
| typedef mem_block_t mem_heap_t |
Definition at line 94 of file mem0mem.c.
References mem_alloc_func().
00096 : free storage */ 00097 ulint n, /* in: desired number of bytes */ 00098 const char* file_name, /* in: file name where created */ 00099 ulint line) /* in: line where created */ 00100 { 00101 return(mem_alloc_func(n, file_name, line)); 00102 }
Here is the call graph for this function:

| UNIV_INLINE void mem_free_func | ( | void * | ptr, | |
| const char * | file_name, | |||
| ulint | line | |||
| ) |
| UNIV_INLINE void* mem_heap_alloc | ( | mem_heap_t * | heap, | |
| ulint | n | |||
| ) |
Referenced by btr_copy_externally_stored_field(), btr_cur_pessimistic_update(), btr_search_info_create(), commit_node_create(), dict_create_add_foreign_to_dictionary(), dict_create_foreign_constraints_low(), dict_create_sys_columns_tuple(), dict_create_sys_fields_tuple(), dict_create_sys_indexes_tuple(), dict_create_sys_tables_tuple(), dict_foreign_parse_drop_constraints(), dict_index_add_to_cache(), dict_load_columns(), dict_load_fields(), dict_load_foreign_cols(), dict_load_indexes(), dict_mem_foreign_create(), dict_mem_index_create(), dict_mem_table_create(), dict_scan_id(), dict_scan_table_name(), dict_table_rename_in_cache(), dict_tree_build_node_ptr(), dtuple_convert_big_rec(), dyn_array_add_block(), ha_insert_for_fold(), ib_list_add_after(), ib_list_create_heap(), ib_vector_create(), ib_vector_push(), ibuf_entry_build(), ibuf_new_search_tuple_build(), ibuf_search_tuple_build(), ind_create_graph_create(), ins_node_create(), lock_rec_copy(), lock_rec_create(), lock_table_create(), mem_heap_cat(), mem_heap_dup(), mem_heap_printf(), mem_heap_strcat(), opt_clust_access(), opt_search_plan(), opt_search_plan_for_table(), page_validate(), pars_assignment_statement(), pars_column_assignment(), pars_elsif_element(), pars_exit_statement(), pars_fetch_statement(), pars_for_statement(), pars_func_low(), pars_if_statement(), pars_info_add_dulint_literal(), pars_info_add_function(), pars_info_add_id(), pars_info_add_int4_literal(), pars_info_add_literal(), pars_info_create(), pars_open_statement(), pars_order_by(), pars_procedure_definition(), pars_return_statement(), pars_row_printf_statement(), pars_while_statement(), que_fork_create(), que_thr_create(), read_cursor_view_create_for_mysql(), read_view_create_low(), rec_copy_prefix_to_dtuple(), rec_get_offsets_func(), recv_add_to_hash_table(), roll_node_create(), row_build(), row_build_row_ref(), row_create_prebuilt(), row_get_prebuilt_insert_row(), row_ins_alloc_sys_fields(), row_ins_cascade_calc_update_vec(), row_purge_node_create(), row_rec_to_index_entry(), row_truncate_table_for_mysql(), row_undo_node_create(), row_upd_index_parse(), row_upd_index_replace_new_col_vals(), row_upd_index_replace_new_col_vals_index_pos(), row_upd_store_row(), row_vers_build_for_consistent_read(), row_vers_build_for_semi_consistent_read(), sel_node_create(), 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(), sym_tab_create(), tab_create_graph_create(), trx_undo_arr_create(), trx_undo_prev_version_build(), trx_undo_update_rec_get_update(), and upd_node_create().
Here is the caller graph for this function:

| void* mem_heap_cat | ( | mem_heap_t * | heap, | |
| const void * | b1, | |||
| ulint | len1, | |||
| const void * | b2, | |||
| ulint | len2 | |||
| ) |
Definition at line 135 of file mem0mem.c.
References mem_heap_alloc(), and memcpy.
00137 : the result */ 00138 mem_heap_t* heap, /* in: memory heap where result is allocated */ 00139 const void* b1, /* in: block 1 */ 00140 ulint len1, /* in: length of b1, in bytes */ 00141 const void* b2, /* in: block 2 */ 00142 ulint len2) /* in: length of b2, in bytes */ 00143 { 00144 void* res = mem_heap_alloc(heap, len1 + len2); 00145 00146 memcpy(res, b1, len1); 00147 memcpy((char*)res + len1, b2, len2); 00148 00149 return(res); 00150 }
Here is the call graph for this function:

| UNIV_INLINE mem_heap_t* mem_heap_create_func | ( | ulint | n, | |
| void * | init_block, | |||
| ulint | type, | |||
| const char * | file_name, | |||
| ulint | line | |||
| ) |
| void* mem_heap_dup | ( | mem_heap_t * | heap, | |
| const void * | data, | |||
| ulint | len | |||
| ) |
Definition at line 121 of file mem0mem.c.
References mem_heap_alloc(), and memcpy.
Referenced by mem_heap_strdup(), and pars_sql().
00123 : a copy of the data */ 00124 mem_heap_t* heap, /* in: memory heap where copy is allocated */ 00125 const void* data, /* in: data to be copied */ 00126 ulint len) /* in: length of data, in bytes */ 00127 { 00128 return(memcpy(mem_heap_alloc(heap, len), data, len)); 00129 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE void mem_heap_empty | ( | mem_heap_t * | heap | ) |
Referenced by btr_attach_half_pages(), btr_page_split_and_insert(), btr_validate_level(), ins_node_set_new_row(), lock_release_off_kernel(), read_view_close_for_mysql(), recv_sys_empty_hash(), row_purge(), row_scan_and_check_index(), row_sel_build_committed_vers_for_mysql(), row_sel_build_prev_vers(), row_sel_build_prev_vers_for_mysql(), row_undo(), row_upd(), row_upd_store_row(), row_vers_build_for_consistent_read(), trx_commit_off_kernel(), and trx_purge().
Here is the caller graph for this function:

| UNIV_INLINE void mem_heap_free_func | ( | mem_heap_t * | heap, | |
| const char * | file_name, | |||
| ulint | line | |||
| ) |
| UNIV_INLINE void mem_heap_free_heap_top | ( | mem_heap_t * | heap, | |
| byte * | old_top | |||
| ) |
| UNIV_INLINE void mem_heap_free_top | ( | mem_heap_t * | heap, | |
| ulint | n | |||
| ) |
| UNIV_INLINE byte* mem_heap_get_heap_top | ( | mem_heap_t * | heap | ) |
| UNIV_INLINE ulint mem_heap_get_size | ( | mem_heap_t * | heap | ) |
Referenced by dict_index_add_to_cache(), dict_index_remove_from_cache(), dict_table_add_to_cache(), dict_table_remove_from_cache(), dict_table_rename_in_cache(), recv_scan_log_recs(), and trx_print().
Here is the caller graph for this function:

| UNIV_INLINE void* mem_heap_get_top | ( | mem_heap_t * | heap, | |
| ulint | n | |||
| ) |
| char* mem_heap_printf | ( | mem_heap_t * | heap, | |
| const char * | format, | |||
| ... | ||||
| ) |
| char* mem_heap_strcat | ( | mem_heap_t * | heap, | |
| const char * | s1, | |||
| const char * | s2 | |||
| ) |
Definition at line 156 of file mem0mem.c.
References mem_heap_alloc(), memcpy, and strlen().
Referenced by row_delete_constraint().
00158 : the result */ 00159 mem_heap_t* heap, /* in: memory heap where string is allocated */ 00160 const char* s1, /* in: string 1 */ 00161 const char* s2) /* in: string 2 */ 00162 { 00163 char* s; 00164 ulint s1_len = strlen(s1); 00165 ulint s2_len = strlen(s2); 00166 00167 s = mem_heap_alloc(heap, s1_len + s2_len + 1); 00168 00169 memcpy(s, s1, s1_len); 00170 memcpy(s + s1_len, s2, s2_len); 00171 00172 s[s1_len + s2_len] = '\0'; 00173 00174 return(s); 00175 }
Here is the call graph for this function:

Here is the caller graph for this function:

| char* mem_heap_strdup | ( | mem_heap_t * | heap, | |
| const char * | str | |||
| ) |
Definition at line 108 of file mem0mem.c.
References mem_heap_dup(), and strlen().
Referenced by dict_create_foreign_constraints_low(), dict_load_foreign(), dict_mem_index_create(), dict_mem_table_add_col(), dict_mem_table_create(), dict_table_rename_in_cache(), and sym_tab_add_bound_id().
00110 : a copy of the string */ 00111 mem_heap_t* heap, /* in: memory heap where string is allocated */ 00112 const char* str) /* in: string to be copied */ 00113 { 00114 return(mem_heap_dup(heap, str, strlen(str) + 1)); 00115 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE char* mem_heap_strdupl | ( | mem_heap_t * | heap, | |
| const char * | str, | |||
| ulint | len | |||
| ) |
Referenced by dict_load_columns(), dict_load_fields(), dict_load_foreign(), dict_load_foreign_cols(), dict_load_foreigns(), dict_load_indexes(), dict_load_table_on_id(), dict_scan_id(), row_rename_table_for_mysql(), and sym_tab_add_id().
Here is the caller graph for this function:

| void mem_init | ( | ulint | size | ) |
Definition at line 114 of file mem0dbg.c.
References mem_comm_pool, mem_pool_create(), mutex_create, SYNC_MEM_HASH, TRUE, ut_a, and UT_LIST_INIT.
Referenced by srv_general_init().
00116 : common pool size in bytes */ 00117 { 00118 #ifdef UNIV_MEM_DEBUG 00119 00120 ulint i; 00121 00122 /* Initialize the hash table */ 00123 ut_a(FALSE == mem_hash_initialized); 00124 00125 mutex_create(&mem_hash_mutex, SYNC_MEM_HASH); 00126 00127 for (i = 0; i < MEM_HASH_SIZE; i++) { 00128 UT_LIST_INIT(*mem_hash_get_nth_cell(i)); 00129 } 00130 00131 UT_LIST_INIT(mem_all_list_base); 00132 00133 mem_hash_initialized = TRUE; 00134 #endif 00135 00136 mem_comm_pool = mem_pool_create(size); 00137 }
Here is the call graph for this function:

Here is the caller graph for this function:

| UNIV_INLINE char* mem_strdup | ( | const char * | str | ) |
Referenced by dict_table_rename_in_cache(), fil_delete_tablespace(), fil_node_create(), fil_rename_tablespace(), fil_rename_tablespace_in_mem(), fil_space_create(), os_file_dirname(), row_add_table_to_background_drop_list(), row_drop_table_for_mysql(), and trx_savepoint_for_mysql().
Here is the caller graph for this function:

| UNIV_INLINE char* mem_strdupl | ( | const char * | str, | |
| ulint | len | |||
| ) |
Referenced by dict_check_tablespaces_and_store_max_id(), dict_get_first_table_name_in_db(), dict_print(), os_file_dirname(), row_ins_invalidate_query_cache(), and row_mysql_recover_tmp_table().
Here is the caller graph for this function:

| UNIV_INLINE char* mem_strdupq | ( | const char * | str, | |
| char | q | |||
| ) |
1.4.7

