xref: /csrg-svn/bin/sh/machdep.h (revision 69272)
147123Sbostic /*-
260698Sbostic  * Copyright (c) 1991, 1993
360698Sbostic  *	The Regents of the University of California.  All rights reserved.
447123Sbostic  *
547123Sbostic  * This code is derived from software contributed to Berkeley by
647123Sbostic  * Kenneth Almquist.
747123Sbostic  *
847123Sbostic  * %sccs.include.redist.c%
947123Sbostic  *
10*69272Schristos  *	@(#)machdep.h	8.2 (Berkeley) 05/04/95
1147123Sbostic  */
1247123Sbostic 
1347123Sbostic /*
1447123Sbostic  * Most machines require the value returned from malloc to be aligned
1547123Sbostic  * in some way.  The following macro will get this right on many machines.
1647123Sbostic  */
1747123Sbostic 
1847123Sbostic #ifndef ALIGN
1947123Sbostic union align {
2047123Sbostic 	int i;
2147123Sbostic 	char *cp;
2247123Sbostic };
2347123Sbostic 
24*69272Schristos #define ALIGN(nbytes)	(((nbytes) + sizeof(union align) - 1) & ~(sizeof(union align) - 1))
2547123Sbostic #endif
26