aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-30 17:04:36 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-30 17:04:36 +0000
commitafc49e1ba98e768547bea358ea64b88a4a58790f (patch)
treedcf295679a4a81dc17e1631f5948c97a9123c9c7 /src/libutil/util.c
parent19e29ff61de92c0e7f7837d4d694067d74d06cae (diff)
downloadrspamd-afc49e1ba98e768547bea358ea64b88a4a58790f.tar.gz
rspamd-afc49e1ba98e768547bea358ea64b88a4a58790f.zip
[Minor] Try to fix openblas issue
Issue: #3102 (likely)
Diffstat (limited to 'src/libutil/util.c')
-rw-r--r--src/libutil/util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/util.c b/src/libutil/util.c
index 5baffebd9..5fe8301fc 100644
--- a/src/libutil/util.c
+++ b/src/libutil/util.c
@@ -2407,6 +2407,16 @@ rspamd_free_zstd_dictionary (struct zstd_dictionary *dict)
#else
extern void openblas_set_num_threads(int num_threads);
#endif
+/*
+ * Openblas creates threads that are not supported by
+ * jemalloc allocator (aside of being bloody stupid). So this hack
+ * is intended to set number of threads to one by default.
+ * FIXME: is it legit to do so in ctor?
+ */
+RSPAMD_CONSTRUCTOR (openblas_stupidity_fix_ctor)
+{
+ openblas_set_num_threads (1);
+}
#endif
void