From: sof Date: Mon, 16 Jul 2001 00:39:04 +0000 (+0000) Subject: [project @ 2001-07-16 00:39:04 by sof] X-Git-Tag: Approximately_9120_patches~1552 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a8b36eb3d8f00cf9561662286c76cc329d4b2254;p=ghc-hetmet.git [project @ 2001-07-16 00:39:04 by sof] eqForeignPtr: implement equality using new primitive --- diff --git a/ghc/lib/std/PrelForeign.lhs b/ghc/lib/std/PrelForeign.lhs index cbaef2a..01f135d 100644 --- a/ghc/lib/std/PrelForeign.lhs +++ b/ghc/lib/std/PrelForeign.lhs @@ -1,5 +1,5 @@ % ------------------------------------------------------------------------------ -% $Id: PrelForeign.lhs,v 1.19 2001/05/18 16:54:05 simonmar Exp $ +% $Id: PrelForeign.lhs,v 1.20 2001/07/16 00:39:04 sof Exp $ % % (c) The University of Glasgow, 1994-2000 % @@ -27,12 +27,8 @@ import PrelPtr 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