import GHC.Show
import GHC.List ( null )
import GHC.Base
-import GHC.IOBase
+-- import GHC.IO
+import GHC.IORef
import GHC.STRef ( STRef(..) )
import GHC.Ptr ( Ptr(..), FunPtr(..) )
import GHC.Err
(# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#))
(MallocPtr mbarr# r) #)
}
- where (I# size) = sizeOf a
- (I# align) = alignment a
+ where !(I# size) = sizeOf a
+ !(I# align) = alignment a
-- | This function is similar to 'mallocForeignPtr', except that the
-- size of the memory required is given explicitly as a number of bytes.
(# s', ForeignPtr (byteArrayContents# (unsafeCoerce# mbarr#))
(PlainPtr mbarr#) #)
}
- where (I# size) = sizeOf a
- (I# align) = alignment a
+ where !(I# size) = sizeOf a
+ !(I# align) = alignment a
-- | This function is similar to 'mallocForeignPtrBytes', except that
-- the internally an optimised ForeignPtr representation with no
PlainForeignPtr r -> f r >> return ()
MallocPtr _ r -> f r >> return ()
_ -> error "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer"
- where
+ where
f r =
noMixing CFinalizers r $
IO $ \s ->
PlainForeignPtr r -> f r >> return ()
MallocPtr _ r -> f r >> return ()
_ -> error "GHC.ForeignPtr: attempt to add a finalizer to a plain pointer"
- where
+ where
f r =
noMixing CFinalizers r $
IO $ \s ->