guarded-allocation-0.0.1: Memory allocation with added stress tests and integrity checks

Safe HaskellSafe
LanguageHaskell98

Foreign.Marshal.Array.Guarded

Contents

Synopsis

immutable arrays

create :: Storable a => Int -> (Ptr a -> IO b) -> IO (ForeignPtr a, b) #

alloca :: Storable a => Int -> (Ptr a -> IO b) -> IO b #

mutable arrays

data MutablePtr a #

new :: Storable a => Int -> IO (MutablePtr a) #

withMutablePtr :: MutablePtr a -> (Ptr a -> IO b) -> IO b #

freeze :: Storable a => Int -> MutablePtr a -> IO (ForeignPtr a) #

The size parameter must match the size passed to new. This is not checked.

freezeInplace :: Storable a => Int -> MutablePtr a -> IO (ForeignPtr a) #

freezeInplace must be the last operation on the MutablePtr and its associated array. This is not checked.

thaw :: Storable a => Int -> ForeignPtr a -> IO (MutablePtr a) #