#ifdef __GLASGOW_HASKELL__
import Foreign.ForeignPtr ( FinalizerPtr )
-import GHC.IO
import GHC.IO.Exception
import GHC.Real
import GHC.Ptr
-- The memory may be deallocated using 'free' or 'finalizerFree' when
-- no longer required.
--
+{-# INLINE malloc #-}
malloc :: Storable a => IO (Ptr a)
malloc = doMalloc undefined
where
-- The memory is freed when @f@ terminates (either normally or via an
-- exception), so the pointer passed to @f@ must /not/ be used after this.
--
+{-# INLINE alloca #-}
alloca :: Storable a => (Ptr a -> IO b) -> IO b
alloca = doAlloca undefined
where