-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Convenience functions for FFI work
--
-- Add several functions missing in the standard Foreign modules:
--
--
-- - copy and move based on Storable
-- - calloc
--
@package missing-foreign
@version 0.1.0
-- | Utilities for primitive marshaling
module Foreign.Marshal.MissingUtils
-- | Uses sizeOf to copy bytes from the second area (source) into
-- the first (destination); the copied areas may not overlap
copy :: Storable a => Ptr a -> Ptr a -> IO ()
-- | Uses sizeOf to copy bytes from the second area (source) into
-- the first (destination); the copied areas may overlap
move :: Storable a => Ptr a -> Ptr a -> IO ()
-- | The module Foreign.Marshal.Alloc.Calloc provides access to the
-- calloc (e.g., allocated 0-initialized chunks of memory outside
-- of the Haskell storage manager).
--
-- If any of these allocation functions fails, an exception is raised.
--
-- The storage allocated is alligned to store any basic foreign types.
module Foreign.Marshal.Alloc.Calloc
-- | Allocate a block of memory that is sufficient to hold values of type
-- a. The size of the area allocated is determined by the
-- sizeOf method from the instance of Storable for the
-- appropriate type. The memory is initalized to 0.
--
-- The memory may be deallocated using free or
-- finalizerFree when no longer required.
calloc :: Storable a => IO (Ptr a)
-- | Allocate a block of memory of the given number of bytes. The block of
-- memory is sufficiently aligned for any of the basic foreign tyes that
-- fit into a memory block of the allocated size. The memory is
-- initialized to 0.
--
-- The memory may be deallocated using free or
-- finalizerFree when no longer required.
callocBytes :: Int -> IO (Ptr a)