]> granicus.if.org Git - apache/commitdiff
* modules/ssl/ssl_scache_shmcb.c (shmcb_safe_clear): Mark with
authorJoe Orton <jorton@apache.org>
Fri, 3 Mar 2006 13:11:39 +0000 (13:11 +0000)
committerJoe Orton <jorton@apache.org>
Fri, 3 Mar 2006 13:11:39 +0000 (13:11 +0000)
"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

modules/ssl/ssl_scache_shmcb.c

index 024d1955ad153b0bee2479d908d4e7d07a9546dc..5402940ae62ee824f24cdae2ca0610a2f865c31e 100644 (file)
@@ -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);