summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2018-11-18 16:35:41 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2018-11-18 16:35:41 +0200
commit4a20764a700cab858f5c87e67dcee77d5ac18ab1 (patch)
treede4e3cf1761b3621c6287ea3ee720d6e5d565961 /src
parentef5f90bc25cdfa958702fb8d03a49647b899dee7 (diff)
wrapper: don't copy if no VERBOSE_FUNCTIONS
Diffstat (limited to 'src')
-rw-r--r--src/wrapper/wrapper.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/wrapper/wrapper.c b/src/wrapper/wrapper.c
index 5411754..5b319f3 100644
--- a/src/wrapper/wrapper.c
+++ b/src/wrapper/wrapper.c
@@ -104,12 +104,11 @@ wrapper_create(const char *const symbol, void *function)
return NULL;
}
+#ifdef WRAPPER_TRACE
const size_t len = strlen(symbol) + 1;
char *copy = malloc(len);
assert(copy && "welp, malloc failed");
memcpy(copy, symbol, len);
-
-#ifdef WRAPPER_TRACE
const size_t sz = &wrapper_end - &wrapper_start;
unsigned char *fun = mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
assert(fun != MAP_FAILED);