November 2017
Intermediate to advanced
264 pages
5h 45m
English
The RUST_MIN_STACK environment variable can override the default stack size of 2 MB for created threads, but not for the main thread. You can also set the thread's stack size in code by using a thread::Builder, like this:
let child = thread::Builder::new().stack_size(32 * 1024 * 1024).spawn(move || {
// code to be executed in thread
}).unwrap();
Here, the child thread gets 32 MB of stack space.
Read now
Unlock full access