[project @ 2001-01-26 17:51:40 by rrt]
[ghc-hetmet.git] / ghc / lib / std / PrelStable.lhs
index 8f6053d..dfa87a0 100644 (file)
@@ -1,15 +1,17 @@
 % -----------------------------------------------------------------------------
-% $Id: PrelStable.lhs,v 1.5 2000/04/14 15:28:24 rrt Exp $
+% $Id: PrelStable.lhs,v 1.8 2000/11/07 10:42:57 simonmar Exp $
 %
-% (c) The GHC Team, 1992-1999
+% (c) The GHC Team, 1992-2000
 %
 
+\section{Module @PrelStable@}
+
 \begin{code}
 {-# OPTIONS -fno-implicit-prelude #-}
 
 module PrelStable 
        ( StablePtr(..)
-       , makeStablePtr   -- :: a -> IO (StablePtr a)    
+       , newStablePtr    -- :: a -> IO (StablePtr a)    
        , deRefStablePtr  -- :: StablePtr a -> a
        , freeStablePtr   -- :: StablePtr a -> IO ()
    ) where
@@ -25,11 +27,11 @@ data StablePtr  a = StablePtr  (StablePtr#  a)
 instance CCallable   (StablePtr a)
 instance CReturnable (StablePtr a)
 
-makeStablePtr  :: a -> IO (StablePtr a)
+newStablePtr   :: a -> IO (StablePtr a)
 deRefStablePtr :: StablePtr a -> IO a
-foreign import "freeStablePtr" freeStablePtr :: StablePtr a -> IO ()
+foreign import unsafe freeStablePtr :: StablePtr a -> IO ()
 
-makeStablePtr a = IO $ \ s ->
+newStablePtr a = IO $ \ s ->
     case makeStablePtr# a s of (# s', sp #) -> (# s', StablePtr sp #)
 
 deRefStablePtr (StablePtr sp) = IO $ \s -> deRefStablePtr# sp s