heap_arr
Allocate fixed-size arrays directly on the heap. For #![no_std] environments too.
The Problem
In Rust, Box::new([T; N]) allocates on the stack first, then moves to the
heap. For large arrays, this can overflow the stack. Rust's optimizer should
handle this in optimized builds, but not in debug.
The Solution
// Instead of this:
let arr = Boxnew; // Stack overflow in debug
// Use this:
let arr: = new_copied; // Allocates directly on heap
Fill arrays via new_cloned(), new_default(), from_fn(), try_from_fn(),
or grab uninitialized memory with uninit() and initialize it yourself.
Everything works in terms of Box<[T; N]> like the standard library.
No dependencies outside alloc, and works in #![no_std].