Skip to content

Commit c6e899a

Browse files
authored
Merge pull request rust-lang#14 from Wind-River/min_stack_size
vxWorks: set DEFAULT_MIN_STACK_SIZE to 256K and use min_stack to pass initial stack size to rtpSpawn
2 parents d5ef9df + db576f8 commit c6e899a

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/libstd/sys/vxworks/process/process_vxworks.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
// Copyright (c) 2019 Wind River Systems, Inc.
2+
13
use crate::io::{self, Error, ErrorKind};
24
use libc::{self, c_int, c_char};
35
use libc::{RTP_ID};
46
use crate::sys;
57
use crate::sys::cvt;
68
use crate::sys::process::rtp;
79
use crate::sys::process::process_common::*;
10+
use crate::sys_common::thread;
811

912
////////////////////////////////////////////////////////////////////////////////
1013
// Command
@@ -57,8 +60,7 @@ impl Command {
5760
self.get_argv().as_ptr() as *const _, // argv
5861
*sys::os::environ() as *const *const c_char,
5962
100 as c_int, // initial priority
60-
0x16000, // initial stack size. 0 defaults
61-
// to 0x4000 in 32 bit and 0x8000 in 64 bit
63+
thread::min_stack(), // initial stack size.
6264
0, // options
6365
0 // task options
6466
);

src/libstd/sys/vxworks/thread.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright (c) 2019 Wind River Systems, Inc.
2+
13
use crate::cmp;
24
use crate::ffi::CStr;
35
use crate::io;
@@ -8,7 +10,7 @@ use crate::time::Duration;
810

911
use crate::sys_common::thread::*;
1012

11-
pub const DEFAULT_MIN_STACK_SIZE: usize = 2 * 1024 * 1024;
13+
pub const DEFAULT_MIN_STACK_SIZE: usize = 0x40000; // 256K
1214

1315
pub struct Thread {
1416
id: libc::pthread_t,

0 commit comments

Comments
 (0)