Subject: 8 octets aligned data with malloc ?
To: None <tech-kern@NetBSD.ORG>
From: Manuel BOUYER <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 10/14/1997 23:18:46
Hi,
I need to malloc some memory space that should be aligned to 8 bytes.
Is there a better way to do this than:
  p = (malloc(size + 0x7) +0x7) & 0x7;
 ?

This is for a chip that needs 64bits aligned adresses for DMA.

PS: The size of the aera malloc'ed is also a multiple of 8 bytes.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
--