ANN: H98 FFI Addendum 1.0, Release Candidate 8
I put a snapshot of the current status of the FFI Addendum as RC8 at http://www.cse.unsw.edu.au/~chak/haskell/ffi/ Despite there still being two unfinished discussion threads, I felt that it is time for another RC, as many people probably don't track the progress in CVS. Cheers, Manuel -=- % Changes since RC7: % * Clarified the lexis of C identifiers and C header file names % * In `ForeignPtr', added `mallocForeignPtrArray' and `mallocForeignPtrArray0' % * Clarified spec of allocations functions adding constraints taken from the % corresponding C routines % * `mallocBytes' and `allocaBytes' must align memory sufficiently for any % basic foreign type that fits into the allocated block % * Removed typos in the description of the module `ForeignPtr' % * Added Peter Gammie to the list of acknowledged people % * `addForeignPtrFinalizer' guarantees that finalizers for a single foreign % pointer are executed in the opposite order as they were added. % * `Storable': Require that the size is divisible by the alignment % * Added Ross Paterson to the list of acknowledged people % * Added hs_free_fun_ptr() and hs_free_stable_ptr() % * Changed order of arguments of `mkIOError' and `annotateIOError' to match % with the current implementation in GHC's FFI libraries.
Since you're retaining foreign language finalizers, you need a way to get the equivalent of Marshal.Alloc.free as such a finalizer, as discussed in http://www.haskell.org/pipermail/ffi/2002-September/000729.html I favour option (3) from there: Marshal.Alloc.finalizerFree :: FunPtr (Ptr a -> IO ()) but doing (4) as well would be harmless, I guess. And then there is the small matter that GHC doesn't currently implement foreign language finalizers, or finalizer ordering.
participants (2)
-
Manuel M T Chakravarty -
Ross Paterson