ForeignPtr naming

Simon Marlow simonmar at microsoft.com
Wed Mar 19 11:30:32 EST 2003


I'm just getting around to converting GHC's ForeignPtr to match the spec
once more.  

This is all fine, except that implementing finalizer ordering slows down
ForeignPtrs quite a bit, in particular mallocForeignPtr takes a 20% hit
just allocating the IORef needed to store the list of finalizers.  Ideas
for a better implementation are welcome.

Anyway, this message is really about what names we should use for the
old Haskell-finalizer versions of newForeignPtr and
addForeignPtrFinalizer (and as such it doesn't have any bearing on the
FFI spec 1.0).  

I'm assuming that we want to keep these functions in some form in GHC -
where to put them is one issue; Foreign.ForeignPtr is a possibility (but
not ForeignPtr), or GHC.ForeignPtr.

I looked back through old mail and couldn't find any suggestions for
names.  Nothing springs immediately to mind -
newHaskellFinalizerForeignObj is clearly horrible.  Ideas?

Cheers,
	Simon




More information about the FFI mailing list