You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to store a large array on the heap, the code produced a run-time error of stack overflow.
fnmain(){let x = Box::new([0;10_000_000]);}
I expected the array to be initialised on the heap.
Instead it seems, the array is being initialised onto the stack, and then placed onto the heap, causing the this error message. thread '<main>' has overflowed its stack.
This is a known issue with Box::new (as well as Rc::new et al). It will be resolved once box syntax (and placement-in for the general case) get stabilised. For now do
#[feature(box_syntax)]fnmain(){let x = box [0;10_000_000];}
I was trying to store a large array on the heap, the code produced a run-time error of stack overflow.
I expected the array to be initialised on the heap.
Instead it seems, the array is being initialised onto the stack, and then placed onto the heap, causing the this error message.
thread '<main>' has overflowed its stack
.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: