Use regular malloc() if RTSan or ASan are enabled.

ms-hamlib-compile-error
Mooneer Salem 2025-06-14 01:46:29 -07:00
parent 66880a3f27
commit 01ff5b9700
2 changed files with 7 additions and 1 deletions

View File

@ -162,12 +162,14 @@ if(ENABLE_ASAN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(CMAKE_OBJCXX_FLAGS "${CMAKE_OBJCXX_FLAGS} -fsanitize=address")
add_definitions(-DSANITIZER_EMABLED)
endif(ENABLE_ASAN)
if(ENABLE_RTSAN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=realtime")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=realtime")
set(CMAKE_OBJCXX_FLAGS "${CMAKE_OBJCXX_FLAGS} -fsanitize=realtime")
add_definitions(-DSANITIZER_EMABLED)
endif(ENABLE_RTSAN)
if(SIGN_WINDOWS_BINARIES)

View File

@ -21,11 +21,15 @@
//=========================================================================
#include "IPipelineStep.h"
#include "codec2_alloc.h"
#if defined(SANITIZER_EMABLED)
#define codec2_malloc(sz) (malloc(sz))
#define codec2_free(ptr) (free(ptr))
#else
extern "C" {
#include "debug_alloc.h"
}
#endif // defined(SANITIZER_EMABLED)
IPipelineStep::~IPipelineStep()
{