X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Foreign%2FForeignPtr.hs;h=a60358788e95196a7eeb1377dbd0690bd1246756;hb=9fa9bc17072a58c0bae2cce4764d38677e96ac29;hp=64313cf76d966fbc20e2a423475b4b4a49272ae2;hpb=7f1f4e7a695c402ddd3a1dc2cc7114e649a78ebc;p=ghc-base.git diff --git a/Foreign/ForeignPtr.hs b/Foreign/ForeignPtr.hs index 64313cf..a603587 100644 --- a/Foreign/ForeignPtr.hs +++ b/Foreign/ForeignPtr.hs @@ -1,15 +1,15 @@ {-# OPTIONS -fno-implicit-prelude #-} ----------------------------------------------------------------------------- --- +-- | -- Module : Foreign.ForeignPtr -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file libraries/core/LICENSE) -- -- Maintainer : ffi@haskell.org --- Stability : experimental --- Portability : non-portable +-- Stability : provisional +-- Portability : portable -- --- $Id: ForeignPtr.hs,v 1.1 2001/06/28 14:15:03 simonmar Exp $ +-- $Id: ForeignPtr.hs,v 1.4 2002/04/24 16:31:44 simonmar Exp $ -- -- This module defines foreign pointers, i.e. addresses with associated -- finalizers. @@ -44,12 +44,8 @@ INSTANCE_TYPEABLE1(ForeignPtr,foreignPtrTc,"ForeignPtr") data ForeignPtr a = ForeignPtr ForeignObj# instance CCallable (ForeignPtr a) -eqForeignPtr :: ForeignPtr a -> ForeignPtr a -> Bool -eqForeignPtr mp1 mp2 - = unsafePerformIO (primEqForeignPtr mp1 mp2) /= (0::Int) - -foreign import "eqForeignObj" unsafe - primEqForeignPtr :: ForeignPtr a -> ForeignPtr a -> IO Int +eqForeignPtr :: ForeignPtr a -> ForeignPtr a -> Bool +eqForeignPtr (ForeignPtr fo1#) (ForeignPtr fo2#) = eqForeignObj# fo1# fo2# instance Eq (ForeignPtr a) where p == q = eqForeignPtr p q