From 10d1d69557f885c59cc9eea04a0f26f21152314a Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Wed, 8 Jun 2016 15:08:16 +0200 Subject: [PATCH] Slightly cleanup code of preload hooks. We instantiate directly with the decltype of a function pointer now, so thereis no need to construct the pointer via a secondary type anymore. --- heaptrack_preload.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/heaptrack_preload.cpp b/heaptrack_preload.cpp index 443e17a..142f84f 100644 --- a/heaptrack_preload.cpp +++ b/heaptrack_preload.cpp @@ -36,10 +36,9 @@ namespace { namespace hooks { -template +template struct hook { - using Signature = SignatureT*; Signature original = nullptr; void init() noexcept @@ -64,7 +63,7 @@ struct hook } }; -#define HOOK(name) struct name ## _t : public hook { \ +#define HOOK(name) struct name ## _t : public hook { \ static constexpr const char* identifier = #name; } name HOOK(malloc); -- 2.7.4