From owner-svn-src-all@freebsd.org Fri Oct 13 17:11:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 120DEE2783B; Fri, 13 Oct 2017 17:11:10 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 CD35B6D770; Fri, 13 Oct 2017 17:11:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DHB9hr003582; Fri, 13 Oct 2017 17:11:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DHB9rt003581; Fri, 13 Oct 2017 17:11:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201710131711.v9DHB9rt003581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 13 Oct 2017 17:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r324602 - in stable: 10/sys/vm 11/sys/vm X-SVN-Group: stable-10 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/vm 11/sys/vm X-SVN-Commit-Revision: 324602 X-SVN-Commit-Repository: base 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.23 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, 13 Oct 2017 17:11:10 -0000 Author: jhb Date: Fri Oct 13 17:11:08 2017 New Revision: 324602 URL: https://svnweb.freebsd.org/changeset/base/324602 Log: MFC 324072: Add UMA_ALIGNOF(). This is a wrapper around _Alignof() that sets the alignment for a zone to the alignment required by a given type. This allows the compiler to determine the proper alignment rather than having the programmer try to guess. Modified: stable/10/sys/vm/uma.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/vm/uma.h Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/vm/uma.h ============================================================================== --- stable/10/sys/vm/uma.h Fri Oct 13 16:31:50 2017 (r324601) +++ stable/10/sys/vm/uma.h Fri Oct 13 17:11:08 2017 (r324602) @@ -296,6 +296,7 @@ uma_zone_t uma_zcache_create(char *name, int size, uma #define UMA_ALIGN_SHORT (sizeof(short) - 1) /* "" short */ #define UMA_ALIGN_CHAR (sizeof(char) - 1) /* "" char */ #define UMA_ALIGN_CACHE (0 - 1) /* Cache line size align */ +#define UMA_ALIGNOF(type) (_Alignof(type) - 1) /* Alignment fit for 'type' */ /* * Destroys an empty uma zone. If the zone is not empty uma complains loudly.