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