From: Joe Orton Date: Fri, 3 Mar 2006 13:11:39 +0000 (+0000) Subject: * modules/ssl/ssl_scache_shmcb.c (shmcb_safe_clear): Mark with X-Git-Tag: 2.3.0~2517 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4f9dd0b7c8f14601830df2c0a88c24cf6946f5df;p=apache * modules/ssl/ssl_scache_shmcb.c (shmcb_safe_clear): Mark with "noinline" attribute for GCC > 3. PR: 38838 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@382799 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ssl/ssl_scache_shmcb.c b/modules/ssl/ssl_scache_shmcb.c index 024d1955ad..5402940ae6 100644 --- a/modules/ssl/ssl_scache_shmcb.c +++ b/modules/ssl/ssl_scache_shmcb.c @@ -234,8 +234,13 @@ static void shmcb_set_safe_time_ex(unsigned char *, const unsigned char *); (const unsigned char *)(&tmp_time)); \ } while(0) -/* This is necessary simply so that the size passed to memset() is not a - * compile-time constant, preventing the compiler from optimising it. */ +/* This is used to persuade the compiler from using an inline memset() + * which has no respect for alignment, since the size parameter is + * often a compile-time constant. GCC >= 4 will aggressively inline + * static functions, so it's marked as explicitly not-inline. */ +#if defined(__GNUC__) && __GNUC__ > 3 +__attribute__((__noinline__)) +#endif static void shmcb_safe_clear(void *ptr, size_t size) { memset(ptr, 0, size);