Skip to main content

DEFAULT_R_STACK_SIZE

Constant DEFAULT_R_STACK_SIZE 

Source
pub const DEFAULT_R_STACK_SIZE: usize = _; // 8_388_608usize
Expand description

Default stack size for the legacy R-sized thread builder (8 MiB).

R doesn’t enforce a specific stack size - it uses whatever the OS provides:

  • Unix: Typically 8 MiB from ulimit -s
  • Windows: 64 MiB for the main thread (since R 4.2)

Rust’s default thread stack is only 2 MiB. The legacy builder reserves 8 MiB to match common R-hosting configurations; this sizing choice does not make R API access from the spawned thread supported.