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) Source #

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

mutable arrays

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

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

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

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

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