aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/function/SecureMemoryAllocator.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/function/SecureMemoryAllocator.cpp b/src/core/function/SecureMemoryAllocator.cpp
index 692c36c5..fccd09fe 100644
--- a/src/core/function/SecureMemoryAllocator.cpp
+++ b/src/core/function/SecureMemoryAllocator.cpp
@@ -28,14 +28,14 @@
#include "SecureMemoryAllocator.h"
-#ifndef MACOS
+#if !defined(MACOS) && defined(DEBUG)
#include <mimalloc.h>
#endif
namespace GpgFrontend {
auto SecureMemoryAllocator::Allocate(std::size_t size) -> void* {
-#ifndef MACOS
+#if !defined(MACOS) && defined(DEBUG)
auto* addr = mi_malloc(size);
#else
auto* addr = malloc(size);
@@ -44,7 +44,7 @@ auto SecureMemoryAllocator::Allocate(std::size_t size) -> void* {
}
auto SecureMemoryAllocator::Reallocate(void* ptr, std::size_t size) -> void* {
-#ifndef MACOS
+#if !defined(MACOS) && defined(DEBUG)
auto* addr = mi_realloc(ptr, size);
#else
auto* addr = realloc(ptr, size);
@@ -53,7 +53,7 @@ auto SecureMemoryAllocator::Reallocate(void* ptr, std::size_t size) -> void* {
}
void SecureMemoryAllocator::Deallocate(void* p) {
-#ifndef MACOS
+#if !defined(MACOS) && defined(DEBUG)
mi_free(p);
#else
free(p);