How to create huge array in Rust directly on the heap, skipping stack?

0

I need to declare and initialize array with size at least 8GB (1 billion of f64 variables). Everything I've tried so far is very complicated or inefficient or gives STATUS_STACK_OVERFLOW (0xC00000FD) error because it's first being created on heap.

How can I do it efficiently, clean and nice?

Is there any way to allocate a standard Rust array directly on the heap, skipping the stack entirely? Solutions proposed here use Vec, which does have performance impact.

arrays
rust
heap
stack-overflow
asked on Stack Overflow May 26, 2021 by MarioPL98 • edited May 26, 2021 by MarioPL98

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0