提交 fa13fd9d 编写于 作者: B Brian Anderson

rt: Remove set_min_stack

上级 cad4918b
......@@ -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();
......
......@@ -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) {
......
......@@ -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
......
......@@ -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);
};
......
......@@ -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;
}
......
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册