From: Simon Ruderich Date: Mon, 10 Jun 2013 12:11:04 +0000 (+0200) Subject: Prevent inlining for more functions. X-Git-Tag: 0.1~85 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=488159627f4f579a80b71c5f7713126864d5623f;p=coloredstderr%2Fcoloredstderr.git Prevent inlining for more functions. Clang is inlining quite aggressively. --- diff --git a/src/ldpreload.h b/src/ldpreload.h index 6ef2911..57f923b 100644 --- a/src/ldpreload.h +++ b/src/ldpreload.h @@ -30,6 +30,12 @@ #include #include +static void *dlsym_function(char const *name) +#ifdef HAVE___ATTRIBUTE__ + __attribute__((noinline)) +#endif +; + /* Load the function name using dlsym() and return it. Terminate program on * failure. Split in function and macro to reduce code inserted into the * function using the macro. */ diff --git a/src/trackfds.h b/src/trackfds.h index 175f1e3..eddff4c 100644 --- a/src/trackfds.h +++ b/src/trackfds.h @@ -300,7 +300,7 @@ static int tracked_fds_remove(int fd) { return 0; } -static int tracked_fds_find_slow(int fd); +static int tracked_fds_find_slow(int fd) __noinline; /* * tracked_fds_find() is called for each hook call and should be as fast as * possible. As most file descriptors are < TRACKFDS_STATIC_COUNT, force the