about summary refs log tree commit diff
path: root/src/rt/rust.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.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.cpp')
-rw-r--r--src/rt/rust.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rt/rust.cpp b/src/rt/rust.cpp
index 6542c7237a7..87520fe44a2 100644
--- a/src/rt/rust.cpp
+++ b/src/rt/rust.cpp
@@ -75,6 +75,8 @@ command_line_args : public kernel_owned<command_line_args>
 
 int check_claims = 0;
 
+const size_t MAIN_STACK_SIZE = 1024*1024;
+
 extern "C" CDECL int
 rust_start(uintptr_t main_fn, int argc, char **argv, void* crate_map) {
 
@@ -85,7 +87,7 @@ rust_start(uintptr_t main_fn, int argc, char **argv, void* crate_map) {
 
     rust_srv *srv = new rust_srv(env);
     rust_kernel *kernel = new rust_kernel(srv, env->num_sched_threads);
-    rust_task_id root_id = kernel->create_task(NULL, "main");
+    rust_task_id root_id = kernel->create_task(NULL, "main", MAIN_STACK_SIZE);
     rust_task *root_task = kernel->get_task_by_id(root_id);
     I(kernel, root_task != NULL);
     rust_scheduler *sched = root_task->sched;