diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 4bf51da214bfcaa64b09e0122be2d89a961caf33..89d8c6d12f2f3978799ca46d3268eb997ad98af5 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -445,13 +445,6 @@ migrate_alloc(void *alloc, rust_task_id tid) { } } -// defined in rust_task.cpp -extern size_t g_custom_min_stack_size; -extern "C" CDECL void -set_min_stack(uintptr_t stack_size) { - g_custom_min_stack_size = stack_size; -} - extern "C" CDECL int sched_threads() { rust_task *task = rust_scheduler::get_task(); diff --git a/src/rt/rust_task.cpp b/src/rt/rust_task.cpp index d6f43ca079435aeb69f6e05a1ce3cfb543b41af8..1bf62e42f014db85fcedc717bdcfdbf58b1943f8 100644 --- a/src/rt/rust_task.cpp +++ b/src/rt/rust_task.cpp @@ -65,18 +65,6 @@ const uint8_t stack_canary[] = {0xAB, 0xCD, 0xAB, 0xCD, 0xAB, 0xCD, 0xAB, 0xCD, 0xAB, 0xCD, 0xAB, 0xCD}; -// Stack size -size_t g_custom_min_stack_size = 0; - -static size_t -get_min_stk_size(size_t default_size) { - if (g_custom_min_stack_size != 0) { - return g_custom_min_stack_size; - } else { - return default_size; - } -} - static size_t get_next_stk_size(rust_scheduler *sched, rust_task *task, size_t min, size_t current, size_t requested) { @@ -157,7 +145,7 @@ new_stk(rust_scheduler *sched, rust_task *task, size_t requested_sz) } // The minimum stack size, in bytes, of a Rust stack, excluding red zone - size_t min_sz = get_min_stk_size(sched->min_stack_size); + size_t min_sz = sched->min_stack_size; // Try to reuse an existing stack segment if (task->stk != NULL && task->stk->prev != NULL) { diff --git a/src/rt/rustrt.def.in b/src/rt/rustrt.def.in index 052f4a42779cd4405cec886ae21c03322d2ec73a..50981882ecd321e8923b4d76819ef49259347906 100644 --- a/src/rt/rustrt.def.in +++ b/src/rt/rustrt.def.in @@ -49,7 +49,6 @@ rust_getcwd rust_task_is_unwinding rust_task_sleep rust_get_task -set_min_stack sched_threads shape_log_str squareroot diff --git a/src/test/run-fail/morestack4.rs b/src/test/run-fail/morestack4.rs index b36372d74e1ced0a278367394c627d69ba8685ea..8f0ccec560f7164bf4ab6e15ac0a503f863bff56 100644 --- a/src/test/run-fail/morestack4.rs +++ b/src/test/run-fail/morestack4.rs @@ -4,10 +4,6 @@ use std; -native mod rustrt { - fn set_min_stack(size: uint); -} - fn getbig_and_fail(&&i: int) { let r = and_then_get_big_again(@0); if i != 0 { @@ -21,7 +17,6 @@ fn getbig_and_fail(&&i: int) { } fn main() { - rustrt::set_min_stack(256u); task::spawn {|| getbig_and_fail(1); }; diff --git a/src/test/run-pass/morestack5.rs b/src/test/run-pass/morestack5.rs index 6c1d906e1e6cfcbfcbf87fdaef04f445801aea96..ecd187ae44ad44944086d15356a0e5645f31917d 100644 --- a/src/test/run-pass/morestack5.rs +++ b/src/test/run-pass/morestack5.rs @@ -3,10 +3,6 @@ use std; import task; -native mod rustrt { - fn set_min_stack(size: uint); -} - fn getbig(&&i: int) { if i != 0 { getbig(i - 1); @@ -16,7 +12,6 @@ fn getbig(&&i: int) { fn main() { let sz = 400u; while sz < 500u { - rustrt::set_min_stack(sz); task::join(task::spawn_joinable {|| getbig(200) }); sz += 1u; } diff --git a/src/test/run-pass/morestack6.rs b/src/test/run-pass/morestack6.rs index 2e30b942c1e4097432025d75bb7c986a877b7d54..66954c29d9835b3bf38a2754b0761e6892aebe5f 100644 --- a/src/test/run-pass/morestack6.rs +++ b/src/test/run-pass/morestack6.rs @@ -6,7 +6,6 @@ import std::rand; native mod rustrt { - fn set_min_stack(size: uint); fn debug_get_stk_seg() -> *u8; fn unsupervise(); @@ -71,7 +70,6 @@ fn main() { for f in fns { let sz = rng.next() % 256u32 + 256u32; let frame_backoff = rng.next() % 10u32 + 1u32; - rustrt::set_min_stack(sz as uint); task::join(task::spawn_joinable {|| runtest(f, frame_backoff);}); } } \ No newline at end of file