about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-01-29 21:20:36 -0800
committerBrian Anderson <banderson@mozilla.com>2012-01-29 21:20:39 -0800
commit6548cdd59beca24a90f41d6507cb615e67828b07 (patch)
tree15e0547e2c14ee150e35d4c78d4922b85102cb5f /src/rt/rust_kernel.cpp
parent361f90e618c081afe2fa8b0a67370610781e413e (diff)
downloadrust-6548cdd59beca24a90f41d6507cb615e67828b07.tar.gz
rust-6548cdd59beca24a90f41d6507cb615e67828b07.zip
rt: Make the initial segment of the main task's stack 1MB
This is a trick to fool microbenchmarks. Closes #1681
Diffstat (limited to 'src/rt/rust_kernel.cpp')
-rw-r--r--src/rt/rust_kernel.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rt/rust_kernel.cpp b/src/rt/rust_kernel.cpp
index a7e4ee2e450..c5322e65e41 100644
--- a/src/rt/rust_kernel.cpp
+++ b/src/rt/rust_kernel.cpp
@@ -151,15 +151,21 @@ rust_kernel::fail() {
 }
 
 rust_task_id
-rust_kernel::create_task(rust_task *spawner, const char *name) {
+rust_kernel::create_task(rust_task *spawner, const char *name,
+                         size_t init_stack_sz) {
     scoped_lock with(_kernel_lock);
     rust_scheduler *thread = threads[isaac_rand(&rctx) % num_threads];
-    rust_task *t = thread->create_task(spawner, name);
+    rust_task *t = thread->create_task(spawner, name, init_stack_sz);
     t->user.id = max_id++;
     task_table.put(t->user.id, t);
     return t->user.id;
 }
 
+rust_task_id
+rust_kernel::create_task(rust_task *spawner, const char *name) {
+    return create_task(spawner, name, env->min_stack_size);
+}
+
 rust_task *
 rust_kernel::get_task_by_id(rust_task_id id) {
     scoped_lock with(_kernel_lock);