Skip to content

Commit bc77d7b

Browse files
committed
libcore: Add sys::set_min_stack
Adding this back to the library as a stopgap measure to recover some benchmark performance. See #1527.
1 parent b93ed36 commit bc77d7b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/libcore/sys.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ native mod rustrt {
2121
fn unsupervise();
2222
fn shape_log_str<T>(t: *sys::type_desc, data: T) -> str;
2323
fn rust_set_exit_status(code: int);
24+
fn set_min_stack(size: uint);
2425
}
2526

2627
#[abi = "rust-intrinsic"]
@@ -105,6 +106,22 @@ fn set_exit_status(code: int) {
105106
rustrt::rust_set_exit_status(code);
106107
}
107108

109+
// FIXME: #1495 - This shouldn't exist
110+
#[doc(
111+
brief =
112+
"Globally set the minimum size, in bytes, of a stack segment",
113+
desc =
114+
"Rust tasks have segmented stacks that are connected in a linked list \
115+
allowing them to start very small and grow very large. In some \
116+
situations this can result in poor performance. Calling this function \
117+
will set the minimum size of all stack segments allocated in the \
118+
future, for all tasks."
119+
)]
120+
#[deprecated]
121+
fn set_min_stack(size: uint) {
122+
rustrt::set_min_stack(size);
123+
}
124+
108125
// Local Variables:
109126
// mode: rust;
110127
// fill-column: 78;

0 commit comments

Comments
 (0)