xref: /csrg-svn/bin/sh/machdep.h (revision 47123)
1*47123Sbostic /*-
2*47123Sbostic  * Copyright (c) 1991 The Regents of the University of California.
3*47123Sbostic  * All rights reserved.
4*47123Sbostic  *
5*47123Sbostic  * This code is derived from software contributed to Berkeley by
6*47123Sbostic  * Kenneth Almquist.
7*47123Sbostic  *
8*47123Sbostic  * %sccs.include.redist.c%
9*47123Sbostic  *
10*47123Sbostic  *	@(#)machdep.h	5.1 (Berkeley) 03/07/91
11*47123Sbostic  */
12*47123Sbostic 
13*47123Sbostic /*
14*47123Sbostic  * Most machines require the value returned from malloc to be aligned
15*47123Sbostic  * in some way.  The following macro will get this right on many machines.
16*47123Sbostic  */
17*47123Sbostic 
18*47123Sbostic #ifndef ALIGN
19*47123Sbostic union align {
20*47123Sbostic 	int i;
21*47123Sbostic 	char *cp;
22*47123Sbostic };
23*47123Sbostic 
24*47123Sbostic #define ALIGN(nbytes)	((nbytes) + sizeof(union align) - 1 &~ (sizeof(union align) - 1))
25*47123Sbostic #endif
26