From 03a420aa1621247b8cb353b511fc661962188556 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 30 May 2024 15:40:12 -0700 Subject: [PATCH] Disable tracy memory tracking when asan enabled --- src/main/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/main.cpp b/src/main/main.cpp index eecffa70f7..7f841e3563 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -289,6 +289,17 @@ tracyEnabled(std::lock_guard const& _guard) return TRACY_STATE != TRACY_STOPPED; } +#ifdef __has_feature +#if __has_feature(address_sanitizer) +#define ASAN_ENABLED +#endif +#else +#ifdef __SANITIZE_ADDRESS__ +#define ASAN_ENABLED +#endif +#endif + +#ifndef ASAN_ENABLED void* operator new(std::size_t count) { @@ -334,7 +345,8 @@ operator delete[](void* ptr) noexcept } free(ptr); } -#endif +#endif // ASAN_ENABLED +#endif // USE_TRACY int main(int argc, char* const* argv)