summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2016-04-28 11:28:02 +0300
committerMonty <monty@mariadb.org>2016-04-28 16:36:02 +0300
commitfabeab781920dfcaf8e606708ba2c6812f6ae5d8 (patch)
treed3a17702cbc67ed2d31f820e4b2f0988436e86b6 /sql/sql_plugin.cc
parentdafed5b51591ad85ef7724156f135d5be8fe698d (diff)
downloadmariadb-git-fabeab781920dfcaf8e606708ba2c6812f6ae5d8.tar.gz
Cleanups
- Avoid some realloc() during startup - Ensure that file_key_management_plugin frees it's memory early, even if it's linked statically. - Fixed compiler warnings from unused variables and missing destructors - Fixed wrong indentation
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index dbe19674cf2..f540c268923 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1544,22 +1544,26 @@ int plugin_init(int *argc, char **argv, int flags)
init_alloc_root(&plugin_vars_mem_root, 4096, 4096, MYF(0));
init_alloc_root(&tmp_root, 4096, 4096, MYF(0));
- if (my_hash_init(&bookmark_hash, &my_charset_bin, 16, 0, 0,
+ if (my_hash_init(&bookmark_hash, &my_charset_bin, 32, 0, 0,
get_bookmark_hash_key, NULL, HASH_UNIQUE))
goto err;
mysql_mutex_init(key_LOCK_plugin, &LOCK_plugin, MY_MUTEX_INIT_FAST);
+ /*
+ The 80 is from 2016-04-27 when we had 71 default plugins
+ Big enough to avoid many mallocs even in future
+ */
if (my_init_dynamic_array(&plugin_dl_array,
sizeof(struct st_plugin_dl *), 16, 16, MYF(0)) ||
my_init_dynamic_array(&plugin_array,
- sizeof(struct st_plugin_int *), 16, 16, MYF(0)))
+ sizeof(struct st_plugin_int *), 80, 32, MYF(0)))
goto err;
for (i= 0; i < MYSQL_MAX_PLUGIN_TYPE_NUM; i++)
{
- if (my_hash_init(&plugin_hash[i], system_charset_info, 16, 0, 0,
+ if (my_hash_init(&plugin_hash[i], system_charset_info, 32, 0, 0,
get_plugin_hash_key, NULL, HASH_UNIQUE))
goto err;
}