Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Oct 2017 17:11:09 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
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
Message-ID:  <201710131711.v9DHB9rt003581@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



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