From bc77d7bdb0d76382865c7b5efd1531e7ac8362fc Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 14 Jan 2012 19:21:23 -0800 Subject: [PATCH] libcore: Add sys::set_min_stack Adding this back to the library as a stopgap measure to recover some benchmark performance. See #1527. --- src/libcore/sys.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/libcore/sys.rs b/src/libcore/sys.rs index 96e5947daf0..f022532eefc 100644 --- a/src/libcore/sys.rs +++ b/src/libcore/sys.rs @@ -21,6 +21,7 @@ native mod rustrt { fn unsupervise(); fn shape_log_str(t: *sys::type_desc, data: T) -> str; fn rust_set_exit_status(code: int); + fn set_min_stack(size: uint); } #[abi = "rust-intrinsic"] @@ -105,6 +106,22 @@ fn set_exit_status(code: int) { rustrt::rust_set_exit_status(code); } +// FIXME: #1495 - This shouldn't exist +#[doc( + brief = + "Globally set the minimum size, in bytes, of a stack segment", + desc = + "Rust tasks have segmented stacks that are connected in a linked list \ + allowing them to start very small and grow very large. In some \ + situations this can result in poor performance. Calling this function \ + will set the minimum size of all stack segments allocated in the \ + future, for all tasks." +)] +#[deprecated] +fn set_min_stack(size: uint) { + rustrt::set_min_stack(size); +} + // Local Variables: // mode: rust; // fill-column: 78;