diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-08 22:04:36 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-08 22:04:36 +0100 |
commit | c1c8dba96ef13bfc8725a5142d751601c48c6719 (patch) | |
tree | 03b0921667029da36e23194074b84029e80c56df /src/fuzzy_storage.c | |
parent | 6538f7ff7c62de807adca85e5db49d7cccab67d4 (diff) | |
download | rspamd-c1c8dba96ef13bfc8725a5142d751601c48c6719.tar.gz rspamd-c1c8dba96ef13bfc8725a5142d751601c48c6719.zip |
[Feature] Use heap in LRU caches
Signed-off-by: Vsevolod Stakhov <vsevolod@highsecure.ru>
Diffstat (limited to 'src/fuzzy_storage.c')
-rw-r--r-- | src/fuzzy_storage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fuzzy_storage.c b/src/fuzzy_storage.c index 4ab92cc9f..f43cb3f44 100644 --- a/src/fuzzy_storage.c +++ b/src/fuzzy_storage.c @@ -1162,7 +1162,7 @@ fuzzy_parse_keypair (rspamd_mempool_t *pool, key->key = kp; keystat = g_slice_alloc0 (sizeof (*keystat)); /* Hash of ip -> fuzzy_key_stat */ - keystat->last_ips = rspamd_lru_hash_new_full (0, 1024, + keystat->last_ips = rspamd_lru_hash_new_full (1024, (GDestroyNotify)rspamd_inet_address_destroy, fuzzy_key_stat_dtor, rspamd_inet_address_hash, rspamd_inet_address_equal); key->stat = keystat; @@ -1213,7 +1213,7 @@ init_fuzzy (struct rspamd_config *cfg) ctx->keypair_cache_size = DEFAULT_KEYPAIR_CACHE_SIZE; ctx->keys = g_hash_table_new_full (fuzzy_kp_hash, fuzzy_kp_equal, NULL, fuzzy_key_dtor); - ctx->errors_ips = rspamd_lru_hash_new_full (0, 1024, + ctx->errors_ips = rspamd_lru_hash_new_full (1024, (GDestroyNotify) rspamd_inet_address_destroy, g_free, rspamd_inet_address_hash, rspamd_inet_address_equal); |