-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instantiating the array via default seems to have a very large stack footprint #108
Comments
Interesting. Anything over |
Some additional info from playing around with this: Using |
Yes, The problem is mostly due to Rust/LLVM in the unoptimized debug mode simply not performing ANY return-value optimization, resulting in many duplicate copies on the stack as it is passed around. There isn't much I can do about that, other than providing an API to initialize a generic-array within an already existing chunk of memory, but that's rather obtuse. Perhaps there is an issue for Rust itself regarding return-value optimizations, but for now all I can do is recommend you compile with opt-level=1 or 2 for your |
sounds good, thanks! |
RFC about Return Value Optimization / Placement by Return: rust-lang/rfcs#2884 |
May be misunderstanding something here, but it looks like the instantiation process has an unnecessarily heavy stack footprint. I expect to have a few MB of stack space available, but can't instantiate an array of size larger than ~200kB.
The text was updated successfully, but these errors were encountered: