summaryrefslogtreecommitdiff
path: root/src/debugallocation.cc
diff options
context:
space:
mode:
authorAliaksey Kandratsenka <alkondratenko@gmail.com>2016-03-12 18:10:19 -0800
committerAliaksey Kandratsenka <alkondratenko@gmail.com>2017-05-14 19:04:55 -0700
commitbb77979dea796ab743e1308af25e9259ec97f2b1 (patch)
treec40fa7c6c585f7b0ec90f3c3d6c8a18a06952a9f /src/debugallocation.cc
parent89c74cb79ca41cd75a1f9131af4ea2ab362593ae (diff)
downloadgperftools-bb77979dea796ab743e1308af25e9259ec97f2b1.tar.gz
don't declare throw() on malloc funtions since it is faster
Apparently throw() on functions actually asks compiler to generate code to detect unexpected exceptions. Which prevents tail calls optimization. So in order to re-enable this optimization, we simply don't tell compiler about throw() at all. C++11 noexcept would be even better, but it is not universally available yet. So we change to no exception specifications. Which at least for gcc & clang on Linux (and likely for all ELF platforms, if not just all) really eliminates all overhead of exceptions.
Diffstat (limited to 'src/debugallocation.cc')
-rw-r--r--src/debugallocation.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/debugallocation.cc b/src/debugallocation.cc
index 75d2fff..21df91f 100644
--- a/src/debugallocation.cc
+++ b/src/debugallocation.cc
@@ -1336,7 +1336,7 @@ extern "C" PERFTOOLS_DLL_DECL void tc_delete(void* p) PERFTOOLS_THROW {
force_frame();
}
-extern "C" PERFTOOLS_DLL_DECL void tc_delete_sized(void* p, size_t size) throw() {
+extern "C" PERFTOOLS_DLL_DECL void tc_delete_sized(void* p, size_t size) PERFTOOLS_THROW {
MallocHook::InvokeDeleteHook(p);
DebugDeallocate(p, MallocBlock::kNewType, size);
force_frame();
@@ -1372,7 +1372,7 @@ extern "C" PERFTOOLS_DLL_DECL void tc_deletearray(void* p) PERFTOOLS_THROW {
force_frame();
}
-extern "C" PERFTOOLS_DLL_DECL void tc_deletearray_sized(void* p, size_t size) throw() {
+extern "C" PERFTOOLS_DLL_DECL void tc_deletearray_sized(void* p, size_t size) PERFTOOLS_THROW {
MallocHook::InvokeDeleteHook(p);
DebugDeallocate(p, MallocBlock::kArrayNewType, size);
force_frame();