summaryrefslogtreecommitdiff
path: root/src/utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.cc')
-rw-r--r--src/utils.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/utils.cc b/src/utils.cc
index 1a82787d..2f592325 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2012, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2013, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -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 {