thomas.dubuisson: > Aside from section 5.7 (storable) and comments on 'alignPtr', the only > mention of alignment in the FFI addendum is on > mallocBytes/allocaBytes: > > "The block of memory is sufficiently aligned for any of the basic > foreign types (see Section 3.2) that fits into a memory block of the > allocated size" > > It would be beneficial if this wording was applied to all allocation > routines - such as mallocForeignPtrBytes, mallocForeignPtrArray, etc. > For the curious, this proposal was born from the real-world issue of > pulling Word32's from a ByteString in an efficient but portable manner > (binary is portable but inefficient, a straight forward > unsafePerformIO/peek is efficient but need alignment).
As a side issue, the get/put primitives on Data.Binary should be efficient (though they're about twice as fast when specialized to a strict bytestring... stay tuned for a package in this area). -- Don _______________________________________________ Haskell-prime mailing list Haskell-prime@haskell.org http://www.haskell.org/mailman/listinfo/haskell-prime