X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FForeignPtr.hs;h=dbf6c2c180597ed260f7710205d286be3a3ff1fa;hb=a223a71a0d40523d2fb3a6b84b5da37d9fc719b8;hp=ec6f85033e6ee8ea0b6ddfcb8e38cd666541c476;hpb=81c5adf7c5e41ebe7c533d6f6f2f572691caa6b2;p=ghc-base.git diff --git a/GHC/ForeignPtr.hs b/GHC/ForeignPtr.hs index ec6f850..dbf6c2c 100644 --- a/GHC/ForeignPtr.hs +++ b/GHC/ForeignPtr.hs @@ -1,5 +1,12 @@ -{-# OPTIONS_GHC -XNoImplicitPrelude #-} +{-# LANGUAGE CPP + , NoImplicitPrelude + , BangPatterns + , MagicHash + , UnboxedTuples + #-} {-# OPTIONS_HADDOCK hide #-} +{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-} + ----------------------------------------------------------------------------- -- | -- Module : GHC.ForeignPtr @@ -46,7 +53,6 @@ import GHC.IORef import GHC.STRef ( STRef(..) ) import GHC.Ptr ( Ptr(..), FunPtr(..) ) import GHC.Err -import GHC.Num ( fromInteger ) #include "Typeable.h" @@ -100,7 +106,7 @@ instance Show (ForeignPtr a) where showsPrec p f = showsPrec p (unsafeForeignPtrToPtr f) --- |A Finalizer is represented as a pointer to a foreign function that, at +-- |A finalizer is represented as a pointer to a foreign function that, at -- finalisation time, gets as an argument a plain pointer variant of the -- foreign pointer that the finalizer is associated with. -- @@ -232,7 +238,7 @@ addForeignPtrFinalizer (FunPtr fp) (ForeignPtr p c) = case c of addForeignPtrFinalizerEnv :: FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO () --- ^ like 'addForeignPtrFinalizerEnv' but allows the finalizer to be +-- ^ Like 'addForeignPtrFinalizerEnv' but allows the finalizer to be -- passed an additional environment parameter to be passed to the -- finalizer. The environment passed to the finalizer is fixed by the -- second argument to 'addForeignPtrFinalizerEnv' @@ -357,7 +363,7 @@ unsafeForeignPtrToPtr :: ForeignPtr a -> Ptr a -- To avoid subtle coding errors, hand written marshalling code -- should preferably use 'Foreign.ForeignPtr.withForeignPtr' rather -- than combinations of 'unsafeForeignPtrToPtr' and --- 'touchForeignPtr'. However, the later routines +-- 'touchForeignPtr'. However, the latter routines -- are occasionally preferred in tool generated marshalling code. unsafeForeignPtrToPtr (ForeignPtr fo _) = Ptr fo