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/11/sys/vm/uma.h
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/vm/uma.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/vm/uma.h
==============================================================================
--- stable/11/sys/vm/uma.h      Fri Oct 13 16:31:50 2017        (r324601)
+++ stable/11/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.
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to