
9 Mar
2006
9 Mar
'06
10:04 a.m.
For the moment I am using the C function memalign() like this:
foreign import ccall "static stdlib.h" memalign :: CInt -> CInt -> IO (Ptr CChar)
iirc, memalign is not provided on windows, nor by mingw. so this wouldn't be portable. claus
Storable.alignment is not used, it is there for informational purposes only - i.e. what alignment does this type need. Foreign.malloc should return memory aligned to the maximum alignment required by any primitive type, and any C structure type (the same as malloc(), in other words).