File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -53,10 +53,6 @@ impl Thread {
53
53
54
54
let stack_size = cmp:: max ( stack, min_stack_size ( & attr) ) ;
55
55
56
- // L4Re only supports a maximum of 1Mb per default.
57
- #[ cfg( target_os = "l4re" ) ]
58
- let stack_size = cmp:: min ( stack_size, 1024 * 1024 ) ;
59
-
60
56
match pthread_attr_setstacksize ( & mut attr,
61
57
stack_size) {
62
58
0 => { }
Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ pub fn min_stack() -> usize {
22
22
n => return n - 1 ,
23
23
}
24
24
let amt = env:: var ( "RUST_MIN_STACK" ) . ok ( ) . and_then ( |s| s. parse ( ) . ok ( ) ) ;
25
+ #[ cfg( not( target_os = "l4re" ) ) ]
25
26
let amt = amt. unwrap_or ( 2 * 1024 * 1024 ) ;
27
+ // L4Re only supports a maximum of 1Mb per default.
28
+ #[ cfg( target_os = "l4re" ) ]
29
+ let amt = amt. unwrap_or ( 1024 * 1024 ) ;
30
+
26
31
// 0 is our sentinel value, so ensure that we'll never see 0 after
27
32
// initialization has run
28
33
MIN . store ( amt + 1 , Ordering :: SeqCst ) ;
You can’t perform that action at this time.
0 commit comments