summaryrefslogtreecommitdiff
path: root/src/utils.cc
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2014-05-09 20:40:42 -0700
committerCraig Earls <enderw88@gmail.com>2014-05-09 20:40:42 -0700
commit20b915668f7e6d4be9993e11dfc04ae1760a36f7 (patch)
tree668de51ac7625355aaaa8c3c88aed82344c690c3 /src/utils.cc
parent2906a2f759b67363c070161202596e746921f09c (diff)
parentdbfbf2bc893de3c44dcc08c33811bc274f647672 (diff)
downloadfork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.tar.gz
fork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.tar.bz2
fork-ledger-20b915668f7e6d4be9993e11dfc04ae1760a36f7.zip
Merge commit 'dbfbf2bc893de3c44dcc08c33811bc274f647672'
Diffstat (limited to 'src/utils.cc')
-rw-r--r--src/utils.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils.cc b/src/utils.cc
index 2256d22a..741ce79d 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -229,7 +229,11 @@ static void trace_delete_func(void * ptr, const char * which)
//#if !defined(__has_feature) || !__has_feature(address_sanitizer)
+#ifdef _GLIBCXX_THROW
+void * operator new(std::size_t size) _GLIBCXX_THROW(std::bad_alloc) {
+#else
void * operator new(std::size_t size) throw (std::bad_alloc) {
+#endif
void * ptr = std::malloc(size);
if (DO_VERIFY() && ledger::memory_tracing_active)
ledger::trace_new_func(ptr, "new", size);
@@ -241,7 +245,11 @@ void * operator new(std::size_t size, const std::nothrow_t&) throw() {
ledger::trace_new_func(ptr, "new", size);
return ptr;
}
+#ifdef _GLIBCXX_THROW
+void * operator new[](std::size_t size) _GLIBCXX_THROW(std::bad_alloc) {
+#else
void * operator new[](std::size_t size) throw (std::bad_alloc) {
+#endif
void * ptr = std::malloc(size);
if (DO_VERIFY() && ledger::memory_tracing_active)
ledger::trace_new_func(ptr, "new[]", size);