Adding a function to stdlib to set the min stack size, for programs

that absolutely will not succeed with a large default stack. This
should be removed once we have stack grown working.

Also updated word-count to succeed under the new test framework.
This commit is contained in:
Eric Holk
2011-07-25 15:02:43 -07:00
parent 117e251733
commit e697a52359
5 changed files with 27 additions and 6 deletions

View File

@@ -14,6 +14,7 @@
// FIXME (issue #151): This should be 0x300; the change here is for
// practicality's sake until stack growth is working.
size_t g_min_stack_size = 0x300000;
static size_t get_min_stk_size() {
char *stack_size = getenv("RUST_MIN_STACK");
@@ -21,7 +22,7 @@ static size_t get_min_stk_size() {
return strtol(stack_size, NULL, 0);
}
else {
return 0x300000;
return g_min_stack_size;
}
}