xref: /csrg-svn/bin/sh/machdep.h (revision 60698)
147123Sbostic /*-
2*60698Sbostic  * Copyright (c) 1991, 1993
3*60698Sbostic  *	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*60698Sbostic  *	@(#)machdep.h	8.1 (Berkeley) 05/31/93
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 
2447123Sbostic #define ALIGN(nbytes)	((nbytes) + sizeof(union align) - 1 &~ (sizeof(union align) - 1))
2547123Sbostic #endif
26