libcore: Remove task::set_min_stack
This existed to make up for the lack of stack growth, and wasn't generally safe.
This commit is contained in:
@@ -41,7 +41,6 @@ export join;
|
|||||||
export unsupervise;
|
export unsupervise;
|
||||||
export pin;
|
export pin;
|
||||||
export unpin;
|
export unpin;
|
||||||
export set_min_stack;
|
|
||||||
export task_result;
|
export task_result;
|
||||||
export tr_success;
|
export tr_success;
|
||||||
export tr_failure;
|
export tr_failure;
|
||||||
@@ -65,8 +64,6 @@ native mod rustrt {
|
|||||||
fn get_task_id() -> task_id;
|
fn get_task_id() -> task_id;
|
||||||
fn rust_get_task() -> *rust_task;
|
fn rust_get_task() -> *rust_task;
|
||||||
|
|
||||||
fn set_min_stack(stack_size: uint);
|
|
||||||
|
|
||||||
fn new_task() -> task_id;
|
fn new_task() -> task_id;
|
||||||
fn drop_task(task_id: *rust_task);
|
fn drop_task(task_id: *rust_task);
|
||||||
fn get_task_pointer(id: task_id) -> *rust_task;
|
fn get_task_pointer(id: task_id) -> *rust_task;
|
||||||
@@ -216,15 +213,6 @@ Unpin the current task and future child tasks
|
|||||||
*/
|
*/
|
||||||
fn unpin() { rustrt::unpin_task(); }
|
fn unpin() { rustrt::unpin_task(); }
|
||||||
|
|
||||||
/*
|
|
||||||
Function: set_min_stack
|
|
||||||
|
|
||||||
Set the minimum stack size (in bytes) for tasks spawned in the future.
|
|
||||||
|
|
||||||
This function has global effect and should probably not be used.
|
|
||||||
*/
|
|
||||||
fn set_min_stack(stack_size: uint) { rustrt::set_min_stack(stack_size); }
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function: spawn
|
Function: spawn
|
||||||
|
|
||||||
|
|||||||
@@ -220,10 +220,6 @@ fn main(argv: [str]) {
|
|||||||
iargs += [str::bytes(a)];
|
iargs += [str::bytes(a)];
|
||||||
}
|
}
|
||||||
|
|
||||||
// We can get by with 8k stacks, and we'll probably exhaust our
|
|
||||||
// address space otherwise.
|
|
||||||
task::set_min_stack(8192u);
|
|
||||||
|
|
||||||
let start = time::precise_time_ns();
|
let start = time::precise_time_ns();
|
||||||
|
|
||||||
map_reduce::map_reduce(map, reduce, iargs);
|
map_reduce::map_reduce(map, reduce, iargs);
|
||||||
|
|||||||
@@ -185,10 +185,6 @@ mod map_reduce {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main(argv: [str]) {
|
fn main(argv: [str]) {
|
||||||
// We can get by with 8k stacks, and we'll probably exhaust our
|
|
||||||
// address space otherwise.
|
|
||||||
task::set_min_stack(8192u);
|
|
||||||
|
|
||||||
let inputs = if vec::len(argv) < 2u {
|
let inputs = if vec::len(argv) < 2u {
|
||||||
[input1(), input2(), input3()]
|
[input1(), input2(), input3()]
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
use std;
|
use std;
|
||||||
|
|
||||||
native mod rustrt {
|
native mod rustrt {
|
||||||
fn set_min_stack(size: uint);
|
|
||||||
fn pin_task();
|
fn pin_task();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -31,7 +30,6 @@ resource and_then_get_big_again(_i: ()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
rustrt::set_min_stack(1024u);
|
|
||||||
task::spawn((), fn (&&_i: ()) {
|
task::spawn((), fn (&&_i: ()) {
|
||||||
let r = and_then_get_big_again(());
|
let r = and_then_get_big_again(());
|
||||||
getbig_call_c_and_fail(10000);
|
getbig_call_c_and_fail(10000);
|
||||||
|
|||||||
@@ -4,10 +4,6 @@
|
|||||||
|
|
||||||
use std;
|
use std;
|
||||||
|
|
||||||
native mod rustrt {
|
|
||||||
fn set_min_stack(size: uint);
|
|
||||||
}
|
|
||||||
|
|
||||||
fn getbig_and_fail(&&i: int) {
|
fn getbig_and_fail(&&i: int) {
|
||||||
let r = and_then_get_big_again(@0);
|
let r = and_then_get_big_again(@0);
|
||||||
if i != 0 {
|
if i != 0 {
|
||||||
@@ -27,6 +23,5 @@ resource and_then_get_big_again(_i: @int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
rustrt::set_min_stack(1024u);
|
|
||||||
task::spawn(400, getbig_and_fail);
|
task::spawn(400, getbig_and_fail);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user