]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Try to fix openblas issue
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 30 Oct 2019 17:04:36 +0000 (17:04 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 30 Oct 2019 17:04:36 +0000 (17:04 +0000)
Issue: #3102 (likely)

src/libutil/util.c

index 5baffebd95e6a21e60b23f942335945e28386d78..5fe8301fcd5131ce79ca5bcad1f0ca56cb5fc98c 100644 (file)
@@ -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