Skip to content

Commit 81cefd6

Browse files
committed
Remove memory allocation override for sanitizer
1 parent 911e89a commit 81cefd6

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Source/TestUtilities.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ inline bool throwIfRequiredAndReturnShouldLog()
6767
#define ATTRIBUTE_USED
6868
#endif
6969

70+
// Disable custom allocators when building with Thread or Address Sanitizers
71+
#if !defined(__SANITIZE_THREAD__) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(thread_sanitizer) && !__has_feature(address_sanitizer)
72+
7073
ATTRIBUTE_USED void* operator new (std::size_t sz)
7174
{
7275
if (! logAllocationViolationIfNotAllowed())
@@ -123,6 +126,8 @@ void operator delete[] (void* ptr, size_t) noexcept
123126
}
124127
#endif
125128

129+
#endif
130+
126131
//==============================================================================
127132
std::atomic<AllocatorInterceptor::ViolationBehaviour> AllocatorInterceptor::violationBehaviour (ViolationBehaviour::logToCerr);
128133

0 commit comments

Comments
 (0)