diff options
-rw-r--r-- | src/utils.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils.cc b/src/utils.cc index 1a82787d..bdce009f 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -153,6 +153,8 @@ std::size_t current_memory_size() return memory_size; } +#if !defined(__has_feature) || !__has_feature(address_sanitizer) + static void trace_new_func(void * ptr, const char * which, std::size_t size) { if (! live_memory || ! memory_tracing_active) return; @@ -221,8 +223,12 @@ static void trace_delete_func(void * ptr, const char * which) memory_tracing_active = true; } +#endif // !defined(__has_feature) || !__has_feature(address_sanitizer) + } // namespace ledger +#if !defined(__has_feature) || !__has_feature(address_sanitizer) + void * operator new(std::size_t size) throw (std::bad_alloc) { void * ptr = std::malloc(size); if (DO_VERIFY() && ledger::memory_tracing_active) @@ -268,6 +274,8 @@ void operator delete[](void * ptr, const std::nothrow_t&) throw() { std::free(ptr); } +#endif // !defined(__has_feature) || !__has_feature(address_sanitizer) + namespace ledger { namespace { |