aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenserver/main.cpp')
-rw-r--r--src/zenserver/main.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp
index 2fb01ebf1..4444241cc 100644
--- a/src/zenserver/main.cpp
+++ b/src/zenserver/main.cpp
@@ -17,16 +17,15 @@
#include <zencore/trace.h>
#include <zenhttp/httpserver.h>
+#include <zencore/memory/fmalloc.h>
+#include <zencore/memory/memory.h>
+#include <zencore/memory/memorytrace.h>
+#include <zencore/memory/newdelete.h>
+
#include "config.h"
#include "diag/logging.h"
#include "sentryintegration.h"
-#if ZEN_USE_MIMALLOC
-ZEN_THIRD_PARTY_INCLUDES_START
-# include <mimalloc-new-delete.h>
-ZEN_THIRD_PARTY_INCLUDES_END
-#endif
-
#if ZEN_PLATFORM_WINDOWS
# include <zencore/windows.h>
# include "windows/service.h"
@@ -354,9 +353,6 @@ test_main(int argc, char** argv)
int
main(int argc, char* argv[])
{
-#if ZEN_USE_MIMALLOC
- mi_version();
-#endif
using namespace zen;
if (argc >= 2)
@@ -433,9 +429,17 @@ main(int argc, char* argv[])
{
TraceInit("zenserver");
}
- atexit(TraceShutdown);
#endif // ZEN_WITH_TRACE
+#if ZEN_WITH_MEMTRACK
+ FMalloc* TraceMalloc = MemoryTrace_Create(GMalloc);
+ if (TraceMalloc != GMalloc)
+ {
+ GMalloc = TraceMalloc;
+ MemoryTrace_Initialize();
+ }
+#endif
+
#if ZEN_PLATFORM_WINDOWS
if (ServerOptions.InstallService)
{