diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2013-01-26 19:26:43 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2013-01-26 19:26:43 +0100 |
commit | 25eaec3864a7ffe48b042057f8c07da26b676337 (patch) | |
tree | 05da43a9e66a6b1b4db6551689a61d8acc8cd21c /src/core | |
parent | f4dce0472391432e8af4f2c0e39401d90cb86737 (diff) | |
download | weechat-25eaec3864a7ffe48b042057f8c07da26b676337.zip |
core: use size of 32 for hashtables (instead of 4, 8 or 16)
A size of 32 will use a little more memory but will reduce collisions in key
hashs, and then length of linked lists inside hash structure (faster search in
hashtable).
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-eval.c | 4 | ||||
-rw-r--r-- | src/core/wee-hdata.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/core/wee-eval.c b/src/core/wee-eval.c index b8ad21c5e..1f2c23c32 100644 --- a/src/core/wee-eval.c +++ b/src/core/wee-eval.c @@ -694,7 +694,7 @@ eval_expression (const char *expr, struct t_hashtable *pointers, /* create hashtable pointers if it's NULL */ if (!pointers) { - pointers = hashtable_new (16, + pointers = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_POINTER, NULL, @@ -723,7 +723,7 @@ eval_expression (const char *expr, struct t_hashtable *pointers, /* create hashtable extra_vars if it's NULL */ if (!extra_vars) { - extra_vars = hashtable_new (16, + extra_vars = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING, NULL, diff --git a/src/core/wee-hdata.c b/src/core/wee-hdata.c index 6524a6f76..9e9800210 100644 --- a/src/core/wee-hdata.c +++ b/src/core/wee-hdata.c @@ -93,7 +93,7 @@ hdata_new (struct t_weechat_plugin *plugin, const char *hdata_name, new_hdata->plugin = plugin; new_hdata->var_prev = (var_prev) ? strdup (var_prev) : NULL; new_hdata->var_next = (var_next) ? strdup (var_next) : NULL; - new_hdata->hash_var = hashtable_new (16, + new_hdata->hash_var = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_POINTER, NULL, @@ -101,7 +101,7 @@ hdata_new (struct t_weechat_plugin *plugin, const char *hdata_name, hashtable_set_pointer (new_hdata->hash_var, "callback_free_value", &hdata_free_var); - new_hdata->hash_list = hashtable_new (16, + new_hdata->hash_list = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_POINTER, NULL, @@ -1039,7 +1039,7 @@ hdata_print_log () void hdata_init () { - weechat_hdata = hashtable_new (16, + weechat_hdata = hashtable_new (32, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_POINTER, NULL, |