[project @ 2001-02-22 16:10:12 by rrt]
[ghc-hetmet.git] / ghc / lib / std / PrelStable.lhs
index 09dc0dc..dfa87a0 100644 (file)
@@ -1,15 +1,17 @@
 % -----------------------------------------------------------------------------
-% $Id: PrelStable.lhs,v 1.4 2000/04/10 16:02:58 simonpj 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 -fcompiling-prelude -fno-implicit-prelude #-}
+{-# 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