Skip to content

Commit 4e1292a

Browse files
committed
auto merge of #7728 : bcully/rust/largestack64, r=cmr
Just to get the ball rolling, this patch sets stacks to 4 MB on >32-bit architectures.
2 parents 96b3163 + 7910c72 commit 4e1292a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/rt/rust_env.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
#define RUST_DEBUG_MEM "RUST_DEBUG_MEM"
2828
#define RUST_DEBUG_BORROW "RUST_DEBUG_BORROW"
2929

30+
#define DEFAULT_RUST_MIN_STACK_32 0x300
31+
#define DEFAULT_RUST_MIN_STACK_64 0x400000
32+
3033
static lock_and_signal env_lock;
3134

3235
extern "C" CDECL void
@@ -99,8 +102,10 @@ get_min_stk_size() {
99102
if(minsz) {
100103
return strtol(minsz, NULL, 0);
101104
}
102-
else {
103-
return 0x300;
105+
else if (sizeof(size_t) > 4) {
106+
return DEFAULT_RUST_MIN_STACK_64;
107+
} else {
108+
return DEFAULT_RUST_MIN_STACK_32;
104109
}
105110
}
106111

0 commit comments

Comments
 (0)