Skip to content

Commit

Permalink
Merge pull request #4340 from graydon/asan-tracy-memory-tracking-work…
Browse files Browse the repository at this point in the history
…around

Disable tracy memory tracking when asan enabled

Reviewed-by: dmkozh
  • Loading branch information
latobarita authored May 30, 2024
2 parents a0de604 + 03a420a commit 47f4af7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,17 @@ tracyEnabled(std::lock_guard<std::mutex> 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)
{
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 47f4af7

Please sign in to comment.