| 1 | /*- |
| 2 | * Copyright (c) 1991 The Regents of the University of California. |
| 3 | * 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 5.1 (Berkeley) %G% |
| 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 |