diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/CMakeLists.txt | 16 | ||||
-rw-r--r-- | src/core/function/SecureMemoryAllocator.cpp | 18 |
2 files changed, 8 insertions, 26 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 6ae14968..a5be5827 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -44,15 +44,13 @@ add_library(gpgfrontend_core SHARED ${CORE_SOURCE}) set(_export_file "${CMAKE_CURRENT_SOURCE_DIR}/GpgFrontendCoreExport.h") generate_export_header(gpgfrontend_core EXPORT_FILE_NAME "${_export_file}") -if(NOT APPLE) - target_link_libraries(gpgfrontend_core PUBLIC mimalloc) - if(MINGW) - set_target_properties(mimalloc - PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" - ) - endif() +target_link_libraries(gpgfrontend_core PUBLIC mimalloc) +if(MINGW) + set_target_properties(mimalloc + PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" + ) endif() # qt-aes diff --git a/src/core/function/SecureMemoryAllocator.cpp b/src/core/function/SecureMemoryAllocator.cpp index fccd09fe..f854f816 100644 --- a/src/core/function/SecureMemoryAllocator.cpp +++ b/src/core/function/SecureMemoryAllocator.cpp @@ -28,36 +28,20 @@ #include "SecureMemoryAllocator.h" -#if !defined(MACOS) && defined(DEBUG) #include <mimalloc.h> -#endif namespace GpgFrontend { auto SecureMemoryAllocator::Allocate(std::size_t size) -> void* { -#if !defined(MACOS) && defined(DEBUG) auto* addr = mi_malloc(size); -#else - auto* addr = malloc(size); -#endif return addr; } auto SecureMemoryAllocator::Reallocate(void* ptr, std::size_t size) -> void* { -#if !defined(MACOS) && defined(DEBUG) - auto* addr = mi_realloc(ptr, size); -#else auto* addr = realloc(ptr, size); -#endif return addr; } -void SecureMemoryAllocator::Deallocate(void* p) { -#if !defined(MACOS) && defined(DEBUG) - mi_free(p); -#else - free(p); -#endif -} +void SecureMemoryAllocator::Deallocate(void* p) { mi_free(p); } } // namespace GpgFrontend
\ No newline at end of file |