Kouhei Sutou
null+****@clear*****
Sat Mar 14 23:54:41 JST 2015
Kouhei Sutou 2015-03-14 23:54:41 +0900 (Sat, 14 Mar 2015) New Revision: d5daa79db046486ac1ad608424183ccb487557dc https://github.com/mroonga/mroonga/commit/d5daa79db046486ac1ad608424183ccb487557dc Message: mysql57: support PSI_memory_key for my_strdup() Modified files: ha_mroonga.cpp mrn_mysql_compat.h Modified: ha_mroonga.cpp (+5 -5) =================================================================== --- ha_mroonga.cpp 2015-03-14 23:52:50 +0900 (fe6442c) +++ ha_mroonga.cpp 2015-03-14 23:54:41 +0900 (450fce6) @@ -753,10 +753,10 @@ static void mrn_log_file_update(THD *thd, struct st_mysql_sys_var *var, #ifdef MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR char *old_log_file_name = *old_value_ptr; - *old_value_ptr = my_strdup(new_log_file_name, MYF(MY_WME)); + *old_value_ptr = mrn_my_strdup(new_log_file_name, MYF(MY_WME)); my_free(old_log_file_name); #else - *old_value_ptr = my_strdup(new_log_file_name, MYF(MY_WME)); + *old_value_ptr = mrn_my_strdup(new_log_file_name, MYF(MY_WME)); #endif grn_ctx_fin(&ctx); @@ -794,7 +794,7 @@ static void mrn_default_parser_update(THD *thd, struct st_mysql_sys_var *var, #ifdef MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR my_free(*old_value_ptr); - *old_value_ptr = my_strdup(new_value, MYF(MY_WME)); + *old_value_ptr = mrn_my_strdup(new_value, MYF(MY_WME)); #else *old_value_ptr = (char *)new_value; #endif @@ -848,7 +848,7 @@ static void mrn_vector_column_delimiter_update(THD *thd, struct st_mysql_sys_var #ifdef MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR my_free(*old_value_ptr); - *old_value_ptr = my_strdup(new_value, MYF(MY_WME)); + *old_value_ptr = mrn_my_strdup(new_value, MYF(MY_WME)); #else *old_value_ptr = (char *)new_value; #endif @@ -874,7 +874,7 @@ static void mrn_database_path_prefix_update(THD *thd, if (*old_value_ptr) my_free(*old_value_ptr); if (new_value) - *old_value_ptr = my_strdup(new_value, MYF(MY_WME)); + *old_value_ptr = mrn_my_strdup(new_value, MYF(MY_WME)); else *old_value_ptr = NULL; #else Modified: mrn_mysql_compat.h (+3 -0) =================================================================== --- mrn_mysql_compat.h 2015-03-14 23:52:50 +0900 (632ac77) +++ mrn_mysql_compat.h 2015-03-14 23:54:41 +0900 (9ae6b9a) @@ -144,10 +144,13 @@ #ifdef MRN_HAVE_PSI_MEMORY_KEY # define mrn_my_malloc(size, flags) \ my_malloc(mrn_memory_key, size, flags) +# define mrn_my_strdup(string, flags) \ + my_strdup(mrn_memory_key, string, flags) # define mrn_my_strndup(string, size, flags) \ my_strndup(mrn_memory_key, string, size, flags) #else # define mrn_my_malloc(size, flags) my_malloc(size, flags) +# define mrn_my_stndup(string, flags) my_strdup(string, flags) # define mrn_my_strndup(string, size, flags) \ my_strndup(string, size, flags) #endif -------------- next part -------------- HTML����������������������������... Télécharger