From owner-svn-src-all@FreeBSD.ORG Fri Apr 24 18:07:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2023C1B; Fri, 24 Apr 2015 18:07:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFCB91E65; Fri, 24 Apr 2015 18:07:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3OI7Ypk028393; Fri, 24 Apr 2015 18:07:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3OI7Yml028392; Fri, 24 Apr 2015 18:07:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201504241807.t3OI7Yml028392@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 24 Apr 2015 18:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281945 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Apr 2015 18:07:35 -0000 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