alignment

Ross Paterson ross at soi.city.ac.uk
Thu Jan 9 07:35:33 EST 2003


Two additions I think are required:

1) The spec should state that mallocBytes and allocaBytes return a block
   of memory sufficiently aligned for any of the primitive types supported
   by the architecture.

2) The description of Storable should require

	sizeOf x `mod` alignment x = 0

   The library implementation of mallocArray implicitly assumes this, and
   C also requires that elements of an array are allocated contiguously.



More information about the FFI mailing list