From: Simon Ruderich Date: Mon, 10 Jun 2013 04:27:18 +0000 (+0200) Subject: Prevent inlining of handle_*_pre/post() functions. X-Git-Tag: 0.1~86 X-Git-Url: https://ruderich.org/simon/gitweb/?p=coloredstderr%2Fcoloredstderr.git;a=commitdiff_plain;h=428e15bf687a05783c1fbbcb034b2c3eddb9fab5 Prevent inlining of handle_*_pre/post() functions. --- diff --git a/src/coloredstderr.c b/src/coloredstderr.c index 7a36575..f005c72 100644 --- a/src/coloredstderr.c +++ b/src/coloredstderr.c @@ -135,6 +135,13 @@ static void init_pre_post_string(void) { post_string_size = strlen(post_string); } +/* Don't inline any of the pre/post functions. Keep the hook function as small + * as possible for speed reasons. */ +static void handle_fd_pre(int fd) __noinline; +static void handle_fd_post(int fd) __noinline; +static void handle_file_pre(FILE *stream) __noinline; +static void handle_file_post(FILE *stream) __noinline; + static void handle_fd_pre(int fd) { int saved_errno = errno;