feat: Custom stack size

If a user reports a crash from stacksize - we can try different stack
memory sizes to try and figure out the cause.

Do not try and initialise rayon on 32 bit builds

Fix rayon initialisation, may not have been called before due to badly
formed closure
This commit is contained in:
andy.boot
2023-12-11 23:15:31 +00:00
parent c8b61d2f46
commit e8c7990a17
10 changed files with 69 additions and 21 deletions
+9
View File
@@ -26,6 +26,7 @@ pub struct Config {
pub disable_progress: Option<bool>,
pub depth: Option<usize>,
pub bars_on_right: Option<bool>,
pub stack_size: Option<usize>,
}
impl Config {
@@ -95,6 +96,14 @@ impl Config {
pub fn get_bars_on_right(&self, options: &ArgMatches) -> bool {
Some(true) == self.bars_on_right || options.get_flag("bars_on_right")
}
pub fn get_custom_stack_size(&self, options: &ArgMatches) -> Option<usize> {
let from_cmd_line = options.get_one::<usize>("stack_size");
if from_cmd_line.is_none() {
self.stack_size
} else {
from_cmd_line.copied()
}
}
}
fn convert_min_size(input: &str, iso: bool) -> Option<usize> {