alloca package:base

alloca f executes the computation f, passing as argument a pointer to a temporarily allocated block of memory sufficient to hold values of type a. The memory is freed when f terminates (either normally or via an exception), so the pointer passed to f must not be used after this.
allocaBytes n f executes the computation f, passing as argument a pointer to a temporarily allocated block of memory of n bytes. The block of memory is sufficiently aligned for any of the basic foreign types that fits into a memory block of the allocated size. The memory is freed when f terminates (either normally or via an exception), so the pointer passed to f must not be used after this.
allocaBytesAligned size align f executes the computation f, passing as argument a pointer to a temporarily allocated block of memory of size bytes and aligned to align bytes. The value of align must be a power of two. The memory is freed when f terminates (either normally or via an exception), so the pointer passed to f must not be used after this.
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.
Total bytes allocated
This thread has exceeded its allocation limit. See setAllocationCounter and enableAllocationLimit.
Like mallocArray, but allocated memory is filled with bytes of value zero.
Like callocArray0, but allocated memory is filled with bytes of value zero.
Allocate storage for the given number of elements of a storable type (like malloc, but for multiple elements).
Like mallocArray, 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.
Allocate storage for the given number of elements of a storable type in the pool.
Allocate storage for the given number of elements of a storable type in the pool, but leave room for an extra element to signal the end of the array.
Adjust the size of an array in the given pool.
Adjust the size of an array with an end marker in the given pool.
Disable allocation limit processing for the current thread.
Enables the allocation counter to be treated as a limit for the current thread. When the allocation limit is enabled, if the allocation counter counts down below zero, the thread will be sent the AllocationLimitExceeded asynchronous exception. When this happens, the counter is reinitialised (by default to 100K, but tunable with the +RTS -xq option) so that it can handle the exception and perform any necessary clean up. If it exhausts this additional allowance, another AllocationLimitExceeded exception is sent, and so forth. Like other asynchronous exceptions, the AllocationLimitExceeded exception is deferred while the thread is inside mask or an exception handler in catch. Note that memory allocation is unrelated to live memory, also known as heap residency. A thread can allocate a large amount of memory and retain anything between none and all of it. It is better to think of the allocation limit as a limit on CPU time, rather than a limit on memory. Compared to using timeouts, allocation limits don't count time spent blocked or in foreign calls.
Return the current value of the allocation counter for the current thread.
Every thread has an allocation counter that tracks how much memory has been allocated by the thread. The counter is initialized to zero, and setAllocationCounter sets the current value. The allocation counter counts *down*, so in the absence of a call to setAllocationCounter its value is the negation of the number of bytes of memory allocated by the thread. There are two things that you can do with this counter: Allocation accounting is accurate only to about 4Kbytes.
Attempt to allocate a compact block with the capacity (in bytes) given by the first argument. The Addr# is a pointer to previous compact block of the CNF or nullAddr# to create a new CNF with a single compact block. The resulting block is not known to the GC until compactFixupPointers# is called on it, and care must be taken so that the address does not escape or memory will be leaked.
Sets the allocation counter for the current thread to the given value.