Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Apr 2015 18:07:34 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r281945 - head/sys/sys
Message-ID:  <201504241807.t3OI7Yml028392@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Fri Apr 24 18:07:34 2015
New Revision: 281945
URL: https://svnweb.freebsd.org/changeset/base/281945

Log:
  Add definition to support alloc_align attribute.
  
  gcc 4.9 added support for new alignment attribute alloc_align:
  
  The alloc_align attribute is used to tell the compiler that the function
  return value points to memory, where the returned pointer minimum
  alignment is given by one of the functions parameters. GCC uses this
  information to improve pointer alignment analysis.
  
  This attribute is not (yet) available on clang.

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==============================================================================
--- head/sys/sys/cdefs.h	Fri Apr 24 17:36:26 2015	(r281944)
+++ head/sys/sys/cdefs.h	Fri Apr 24 18:07:34 2015	(r281945)
@@ -395,6 +395,12 @@
 #define	__alloc_size(x)
 #endif
 
+#if __has_attribute(alloc_align) || __GNUC_PREREQ__(4, 9)
+#define	__alloc_align(x)	__attribute__((__alloc_align__(x)))
+#else
+#define	__alloc_align(x)
+#endif
+
 /* XXX: should use `#if __STDC_VERSION__ < 199901'. */
 #if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
 #define	__func__	NULL



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504241807.t3OI7Yml028392>