Allocate storage for the given number of elements of a storable type (like malloc, but for multiple elements).
Moduleghc-internal-9.1003.0Haskell2010
GHC.Internal.Foreign.Marshal.Array
Marshalling support: routines allocating, storing, and retrieving Haskell lists that are represented as arrays in the foreign language
- 22 values
- Packageghc-internal-9.1003.0
- Exports22
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceArray.hs
Marshalling arrays
0 declarationsAllocation
Like mallocArray, but add an extra position to hold a special termination element.
Temporarily allocate space for the given number of elements (like alloca, but for multiple elements).
Like allocaArray, but add an extra position to hold a special termination element.
Adjust the size of an array
Adjust the size of an array including an extra position for the end marker.
Like mallocArray, but allocated memory is filled with bytes of value zero.
Like callocArray0, but allocated memory is filled with bytes of value zero.
Marshalling
Convert an array of given length into a Haskell list. The implementation is tail-recursive and so uses constant stack space.
Convert an array terminated by the given end marker into a Haskell list
Write the list elements consecutive into memory
Write the list elements consecutive into memory and terminate them with the given marker element
Combined allocation and marshalling
Write a list of storable elements into a newly allocated, consecutive sequence of storable values (like new, but for multiple elements).
Write a list of storable elements into a newly allocated, consecutive sequence of storable values, where the end is fixed by the given end marker
Temporarily store a list of storable values in memory (like with, but for multiple elements).
Like withArray, but a terminator indicates where the array ends
Like withArray, but the action gets the number of values as an additional parameter
Like withArrayLen, but a terminator indicates where the array ends
Copying
(argument order: destination, source)
Copy the given number of elements from the second array (source) into the first array (destination); the copied areas may not overlap
Copy the given number of elements from the second array (source) into the first array (destination); the copied areas may overlap
Finding the length
Return the number of elements in an array, excluding the terminator
Indexing
Advance a pointer into an array by the given number of elements