1
module Foreign.StablePtr
2
( -- * Stable references to Haskell values
4
, newStablePtr -- :: a -> IO (StablePtr a)
5
, deRefStablePtr -- :: StablePtr a -> IO a
6
, freeStablePtr -- :: StablePtr a -> IO ()
7
, castStablePtrToPtr -- :: StablePtr a -> Ptr ()
8
, castPtrToStablePtr -- :: Ptr () -> StablePtr a
9
, -- ** The C-side interface
13
import "base" Foreign.StablePtr as This___
17
-- The following definition is available to C programs inter-operating with
18
-- Haskell code when including the header @HsFFI.h@.
20
-- > typedef void *HsStablePtr; /* C representation of a StablePtr */
22
-- Note that no assumptions may be made about the values representing stable
23
-- pointers. In fact, they need not even be valid memory addresses. The only
24
-- guarantee provided is that if they are passed back to Haskell land, the
25
-- function 'deRefStablePtr' will be able to reconstruct the
26
-- Haskell value referred to by the stable pointer.