Skip to content

Commit 18b1e90

Browse files
author
Eric Holk
committed
---
yaml --- r: 3741 b: refs/heads/master c: d7db25e h: refs/heads/master i: 3739: 77ea741 v: v3
1 parent 2b57c62 commit 18b1e90

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 4c0a2ed378cfdf5528cec813f1e02a42891edb2a
2+
refs/heads/master: d7db25e8f60af6894556a14cd420f7523f33e89b

trunk/src/rt/rust_task.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,22 @@
1515
// FIXME (issue #151): This should be 0x300; the change here is for
1616
// practicality's sake until stack growth is working.
1717

18-
static size_t const min_stk_bytes = 0x200000;
18+
static size_t get_min_stk_size() {
19+
char *stack_size = getenv("RUST_MIN_STACK");
20+
if(stack_size) {
21+
return atoi(stack_size);
22+
}
23+
else {
24+
return 0x200000;
25+
}
26+
}
1927

2028
// Task stack segments. Heap allocated and chained together.
2129

2230
static stk_seg*
2331
new_stk(rust_task *task, size_t minsz)
2432
{
33+
size_t min_stk_bytes = get_min_stk_size();
2534
if (minsz < min_stk_bytes)
2635
minsz = min_stk_bytes;
2736
size_t sz = sizeof(stk_seg) + minsz;

0 commit comments

Comments
 (0)