Mallocing array with random access range interface.