aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zencore/include/zencore/zencore.h4
-rw-r--r--zenserver-test/zenserver-test.cpp6
-rw-r--r--zenserver/zenserver.cpp10
3 files changed, 17 insertions, 3 deletions
diff --git a/zencore/include/zencore/zencore.h b/zencore/include/zencore/zencore.h
index 2b411af0e..f6093cb96 100644
--- a/zencore/include/zencore/zencore.h
+++ b/zencore/include/zencore/zencore.h
@@ -202,6 +202,10 @@ ZENCORE_API void zencore_forcelinktests();
} // namespace zen
+#ifndef ZEN_USE_MIMALLOC
+# define ZEN_USE_MIMALLOC 1
+#endif
+
//////////////////////////////////////////////////////////////////////////
#if ZEN_COMPILER_MSC
diff --git a/zenserver-test/zenserver-test.cpp b/zenserver-test/zenserver-test.cpp
index 7cd2bb1d1..794a5fe94 100644
--- a/zenserver-test/zenserver-test.cpp
+++ b/zenserver-test/zenserver-test.cpp
@@ -22,7 +22,9 @@
#include <zenhttp/zenhttp.h>
#include <zenutil/zenserverprocess.h>
-#include <mimalloc.h>
+#if ZEN_USE_MIMALLOC
+# include <mimalloc.h>
+#endif
#include <http_parser.h>
@@ -666,7 +668,9 @@ zen::ZenServerEnvironment TestEnv;
int
main(int argc, char** argv)
{
+# if ZEN_USE_MIMALLOC
mi_version();
+# endif
zen::zencore_forcelinktests();
zen::zenhttp_forcelinktests();
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp
index 62e8609f4..98ca152fa 100644
--- a/zenserver/zenserver.cpp
+++ b/zenserver/zenserver.cpp
@@ -16,8 +16,12 @@
#include <zenutil/zenserverprocess.h>
#include <fmt/format.h>
-#include <mimalloc-new-delete.h>
-#include <mimalloc.h>
+
+#if ZEN_USE_MIMALLOC
+# include <mimalloc-new-delete.h>
+# include <mimalloc.h>
+#endif
+
#include <asio.hpp>
#include <exception>
#include <list>
@@ -569,7 +573,9 @@ main(int argc, char* argv[])
{
using namespace zen;
+#if ZEN_USE_MIMALLOC
mi_version();
+#endif
ZenServerOptions GlobalOptions;
ZenServiceConfig ServiceConfig;