malloc -package:base

Lifted malloc.
Allocates nBytes bytes of memory. If nBytes is 0 it returns Nothing. If the allocation fails (because the system is out of memory), the program is terminated.
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.
Allocate amount * sizeof(tp) bytes on the heap * tp: LlvmType to reserve room for * amount: The nr of tp's which must be allocated
Wrapper of mallocForeignPtrBytes with faster implementation for GHC
Allocate and store the given bytes in memory, returning a pointer to the memory in the remote process.
Lifted mallocArray.
Lifted mallocArray0.
Lifted mallocBytes.
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.
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.
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.
This function is similar to mallocForeignPtr, except that the size of the memory required is given explicitly as a number of bytes.
Allocates nBytes bytes of memory, initialized to 0's. If nBytes is 0 it returns Nothing. If the allocation fails (because the system is out of memory), the program is terminated.
This function is similar to malloc0, allocating (nBlocks * nBlockBytes) bytes, but care is taken to detect possible overflow during multiplication. If the allocation fails (because the system is out of memory), the program is terminated. Since: 2.24