projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2a3d85b
)
correct the documentation for newForeignPtr
author
Simon Marlow
<simonmar@microsoft.com>
Wed, 16 May 2007 08:20:19 +0000
(08:20 +0000)
committer
Simon Marlow
<simonmar@microsoft.com>
Wed, 16 May 2007 08:20:19 +0000
(08:20 +0000)
Foreign/ForeignPtr.hs
patch
|
blob
|
history
diff --git
a/Foreign/ForeignPtr.hs
b/Foreign/ForeignPtr.hs
index
160bf3c
..
21485db
100644
(file)
--- a/
Foreign/ForeignPtr.hs
+++ b/
Foreign/ForeignPtr.hs
@@
-105,8
+105,9
@@
newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPtr a)
-- after the last reference to the foreign object is dropped. Note that there
-- is no guarantee on how soon the finaliser is executed after the last
-- reference was dropped; this depends on the details of the Haskell storage
-- after the last reference to the foreign object is dropped. Note that there
-- is no guarantee on how soon the finaliser is executed after the last
-- reference was dropped; this depends on the details of the Haskell storage
--- manager. The only guarantee is that the finaliser runs before the program
--- terminates.
+-- manager. Indeed, there is no guarantee that the finalizer is executed at
+-- all; a program may exit with finalizers outstanding. (This is true
+-- of GHC, other implementations may give stronger guarantees).
newForeignPtr finalizer p
= do fObj <- newForeignPtr_ p
addForeignPtrFinalizer finalizer fObj
newForeignPtr finalizer p
= do fObj <- newForeignPtr_ p
addForeignPtrFinalizer finalizer fObj