Hoogle Search
Within LTS Haskell 24.50 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a)base Foreign.ForeignPtr This function is similar to mallocArray, but yields a memory area that has a finalizer attached that releases the memory area. As with mallocForeignPtr, it is not guaranteed that the block of memory was allocated by malloc.
mallocForeignPtrArray0 :: Storable a => Int -> IO (ForeignPtr a)base Foreign.ForeignPtr This function is similar to mallocArray0, but yields a memory area that has a finalizer attached that releases the memory area. As with mallocForeignPtr, it is not guaranteed that the block of memory was allocated by malloc.
mallocForeignPtrBytes :: Int -> IO (ForeignPtr a)base Foreign.ForeignPtr This function is similar to mallocForeignPtr, except that the size of the memory required is given explicitly as a number of bytes.
mallocForeignPtr :: Storable a => IO (ForeignPtr a)base Foreign.ForeignPtr.Safe Allocate some memory and return a ForeignPtr to it. The memory will be released automatically when the ForeignPtr is discarded. mallocForeignPtr is equivalent to
do { p <- malloc; newForeignPtr finalizerFree p }although it may be implemented differently internally: you may not assume that the memory returned by mallocForeignPtr has been allocated with malloc. GHC notes: mallocForeignPtr has a heavily optimised implementation in GHC. It uses pinned memory in the garbage collected heap, so the ForeignPtr does not require a finalizer to free the memory. Use of mallocForeignPtr and associated functions is strongly recommended in preference to newForeignPtr with a finalizer.mallocForeignPtrArray :: Storable a => Int -> IO (ForeignPtr a)base Foreign.ForeignPtr.Safe This function is similar to mallocArray, but yields a memory area that has a finalizer attached that releases the memory area. As with mallocForeignPtr, it is not guaranteed that the block of memory was allocated by malloc.
mallocForeignPtrArray0 :: Storable a => Int -> IO (ForeignPtr a)base Foreign.ForeignPtr.Safe This function is similar to mallocArray0, but yields a memory area that has a finalizer attached that releases the memory area. As with mallocForeignPtr, it is not guaranteed that the block of memory was allocated by malloc.
mallocForeignPtrBytes :: Int -> IO (ForeignPtr a)base Foreign.ForeignPtr.Safe This function is similar to mallocForeignPtr, except that the size of the memory required is given explicitly as a number of bytes.
calloc :: Storable a => IO (Ptr a)base Foreign.Marshal.Alloc Like malloc but memory is filled with bytes of value zero.
callocBytes :: Int -> IO (Ptr a)base Foreign.Marshal.Alloc Like mallocBytes, but memory is filled with bytes of value zero.
malloc :: Storable a => IO (Ptr a)base Foreign.Marshal.Alloc 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 may be deallocated using free or finalizerFree when no longer required.