This module provides both the immutable CArray and mutable IOCArray. The
underlying storage is exactly the same - pinned memory on the GC'd heap.
Elements are stored according to the class Storable. You can obtain a
pointer to the array contents to manipulate elements from languages like C.

CArray is 16-byte aligned by default. If you create a CArray with
unsafeForeignPtrToCArray then it may not be aligned. This will be an issue
if you intend to use SIMD instructions.

CArray is similar to Data.Array.Unboxed.UArray but slower if you stay
within Haskell. CArray can handle more types and can be used by external
libraries.

The pointer to the array contents is obtained by withCArray.
The idea is similar to ForeignPtr (used internally here).
The pointer should be used only during execution of the IO action
retured by the function passed as argument to withCArray.

O(1) Turn a ByteString into a CArray. Unsafe because it uses
castForeignPtr and thus is not platform independent. Returns Nothing if
the range specified is larger than the size of the ByteString or the start of
the ByteString does not fulfil the alignment requirement of the resulting
CArray (as specified by the Storable instance).

Allocate memory which is 16-byte aligned. This is essential for SIMD
instructions. We know that mallocPlainForeignPtrBytes will give word-aligned
memory, so we pad enough to be able to return the desired amount of memory
after aligning our pointer.