Changes between Version 16 and Version 17 of ForeignFunctionInterface


Ignore:
Timestamp:
Oct 10, 2009 5:22:18 AM (5 years ago)
Author:
chak@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ForeignFunctionInterface

    v16 v17  
    5656'''TODO:''' Decide whether we allow implementations to implement `stdcall` as `ccall` if that is appropriate for the platform. 
    5757 
     58=== Finalizers === 
     59 
     60Finalizers can only be C functions (not Haskell functions), to avoid the problems discussed in Boehm's paper.  The original FFI addendum makes the following guarantees about finalizers: 
     61 
     62  There is no guarantee on how soon the finalizer is executed after the last reference to the associated foreign pointer was dropped; this depends on the details of the Haskell storage manager. The only guarantee is that the finalizer runs before the program terminates. Whether a finalizer may call back into the Haskell system is system dependent. Portable code may not rely on such callbacks. 
     63 
     64There was some discussion, in the context of GHC's implementation, about these guarantees.  IIRC, the conclusion was that these guarantees are reasonable for C finalizers (but it would be hard for Haskell finalizers to guarantee that they run before the program terminates).  Is that right, or do we need to change the specification here? 
     65 
     66'''TODO:''' Decide whether the current guarantees concerning finalizers are practical. 
     67 
    5868---- 
    5969