about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-11-06 15:16:04 -0800
committerAlex Crichton <alex@alexcrichton.com>2013-11-11 10:40:34 -0800
commit7755ffd0131fa99ca5d58bdd5eab443b44d5a1ff (patch)
treec00e95dee93195cb7744c4a37ea1d4d438db9456 /src/libstd/rt
parent4059b5c4b3b8a57a645982b0770d25f0283dfb06 (diff)
downloadrust-7755ffd0131fa99ca5d58bdd5eab443b44d5a1ff.tar.gz
rust-7755ffd0131fa99ca5d58bdd5eab443b44d5a1ff.zip
Remove #[fixed_stack_segment] and #[rust_stack]
These two attributes are no longer useful now that Rust has decided to leave
segmented stacks behind. It is assumed that the rust task's stack is always
large enough to make an FFI call (due to the stack being very large).

There's always the case of stack overflow, however, to consider. This does not
change the behavior of stack overflow in Rust. This is still normally triggered
by the __morestack function and aborts the whole process.

C stack overflow will continue to corrupt the stack, however (as it did before
this commit as well). The future improvement of a guard page at the end of every
rust stack is still unimplemented and is intended to be the mechanism through
which we attempt to detect C stack overflow.

Closes #8822
Closes #10155
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/args.rs8
-rw-r--r--src/libstd/rt/basic.rs1
-rw-r--r--src/libstd/rt/context.rs3
-rw-r--r--src/libstd/rt/crate_map.rs2
-rw-r--r--src/libstd/rt/global_heap.rs7
-rw-r--r--src/libstd/rt/io/native/file.rs27
-rw-r--r--src/libstd/rt/io/native/process.rs15
-rw-r--r--src/libstd/rt/io/signal.rs1
-rw-r--r--src/libstd/rt/io/stdio.rs2
-rw-r--r--src/libstd/rt/local_ptr.rs2
-rw-r--r--src/libstd/rt/logging.rs1
-rw-r--r--src/libstd/rt/mod.rs2
-rw-r--r--src/libstd/rt/sched.rs1
-rw-r--r--src/libstd/rt/stack.rs4
-rw-r--r--src/libstd/rt/task.rs8
-rw-r--r--src/libstd/rt/test.rs4
-rw-r--r--src/libstd/rt/thread.rs7
-rw-r--r--src/libstd/rt/thread_local_storage.rs23
-rw-r--r--src/libstd/rt/util.rs3
19 files changed, 8 insertions, 113 deletions
diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs
index 24143ba040b..48e58879026 100644
--- a/src/libstd/rt/args.rs
+++ b/src/libstd/rt/args.rs
@@ -117,9 +117,11 @@ mod imp {
         }
     }
 
-    externfn!(fn rust_take_global_args_lock())
-    externfn!(fn rust_drop_global_args_lock())
-    externfn!(fn rust_get_global_args_ptr() -> *mut Option<~~[~str]>)
+    extern {
+        fn rust_take_global_args_lock();
+        fn rust_drop_global_args_lock();
+        fn rust_get_global_args_ptr() -> *mut Option<~~[~str]>;
+    }
 
     #[cfg(test)]
     mod tests {
diff --git a/src/libstd/rt/basic.rs b/src/libstd/rt/basic.rs
index 322c58bc2b8..a8f762c4c8f 100644
--- a/src/libstd/rt/basic.rs
+++ b/src/libstd/rt/basic.rs
@@ -236,7 +236,6 @@ impl Drop for BasicPausible {
 }
 
 fn time() -> Time {
-    #[fixed_stack_segment]; #[inline(never)];
     extern {
         fn get_time(sec: &mut i64, nsec: &mut i32);
     }
diff --git a/src/libstd/rt/context.rs b/src/libstd/rt/context.rs
index b86dbfd6fb0..fcc30ded954 100644
--- a/src/libstd/rt/context.rs
+++ b/src/libstd/rt/context.rs
@@ -119,7 +119,6 @@ impl Context {
 }
 
 extern {
-    #[rust_stack]
     fn swap_registers(out_regs: *mut Registers, in_regs: *Registers);
 }
 
@@ -376,7 +375,6 @@ pub unsafe fn record_sp_limit(limit: uint) {
     unsafe fn target_record_sp_limit(limit: uint) {
         return record_sp_limit(limit as *c_void);
         extern {
-            #[rust_stack]
             fn record_sp_limit(limit: *c_void);
         }
     }
@@ -450,7 +448,6 @@ pub unsafe fn get_sp_limit() -> uint {
     unsafe fn target_get_sp_limit() -> uint {
         return get_sp_limit() as uint;
         extern {
-            #[rust_stack]
             fn get_sp_limit() -> *c_void;
         }
     }
diff --git a/src/libstd/rt/crate_map.rs b/src/libstd/rt/crate_map.rs
index a7a5b0084a2..8decaea1f47 100644
--- a/src/libstd/rt/crate_map.rs
+++ b/src/libstd/rt/crate_map.rs
@@ -49,8 +49,6 @@ pub fn get_crate_map() -> Option<&'static CrateMap<'static>> {
 }
 
 #[cfg(windows)]
-#[fixed_stack_segment]
-#[inline(never)]
 pub fn get_crate_map() -> Option<&'static CrateMap<'static>> {
     use cast::transmute;
     use c_str::ToCStr;
diff --git a/src/libstd/rt/global_heap.rs b/src/libstd/rt/global_heap.rs
index 4964db8f1c1..c6e2724b0f2 100644
--- a/src/libstd/rt/global_heap.rs
+++ b/src/libstd/rt/global_heap.rs
@@ -14,7 +14,6 @@ use unstable::raw;
 use mem::size_of;
 
 extern {
-    #[rust_stack]
     fn abort();
 }
 
@@ -36,8 +35,6 @@ fn align_to(size: uint, align: uint) -> uint {
 
 /// A wrapper around libc::malloc, aborting on out-of-memory
 pub unsafe fn malloc_raw(size: uint) -> *c_void {
-    #[fixed_stack_segment]; #[inline(never)];
-
     let p = malloc(size as size_t);
     if p.is_null() {
         // we need a non-allocating way to print an error here
@@ -48,8 +45,6 @@ pub unsafe fn malloc_raw(size: uint) -> *c_void {
 
 /// A wrapper around libc::realloc, aborting on out-of-memory
 pub unsafe fn realloc_raw(ptr: *mut c_void, size: uint) -> *mut c_void {
-    #[fixed_stack_segment]; #[inline(never)];
-
     let p = realloc(ptr, size as size_t);
     if p.is_null() {
         // we need a non-allocating way to print an error here
@@ -100,8 +95,6 @@ pub unsafe fn exchange_free_(ptr: *c_char) {
 }
 
 pub unsafe fn exchange_free(ptr: *c_char) {
-    #[fixed_stack_segment]; #[inline(never)];
-
     free(ptr as *c_void);
 }
 
diff --git a/src/libstd/rt/io/native/file.rs b/src/libstd/rt/io/native/file.rs
index 6d4f29182dd..69d1159bf91 100644
--- a/src/libstd/rt/io/native/file.rs
+++ b/src/libstd/rt/io/native/file.rs
@@ -98,7 +98,6 @@ impl FileDesc {
 }
 
 impl Reader for FileDesc {
-    #[fixed_stack_segment] #[inline(never)]
     fn read(&mut self, buf: &mut [u8]) -> Option<uint> {
         #[cfg(windows)] type rlen = libc::c_uint;
         #[cfg(not(windows))] type rlen = libc::size_t;
@@ -121,7 +120,6 @@ impl Reader for FileDesc {
 }
 
 impl Writer for FileDesc {
-    #[fixed_stack_segment] #[inline(never)]
     fn write(&mut self, buf: &[u8]) {
         #[cfg(windows)] type wlen = libc::c_uint;
         #[cfg(not(windows))] type wlen = libc::size_t;
@@ -137,7 +135,6 @@ impl Writer for FileDesc {
 }
 
 impl Drop for FileDesc {
-    #[fixed_stack_segment] #[inline(never)]
     fn drop(&mut self) {
         if self.close_on_drop {
             unsafe { libc::close(self.fd); }
@@ -158,7 +155,6 @@ impl CFile {
 }
 
 impl Reader for CFile {
-    #[fixed_stack_segment] #[inline(never)]
     fn read(&mut self, buf: &mut [u8]) -> Option<uint> {
         let ret = do keep_going(buf) |buf, len| {
             unsafe {
@@ -176,14 +172,12 @@ impl Reader for CFile {
         }
     }
 
-    #[fixed_stack_segment] #[inline(never)]
     fn eof(&mut self) -> bool {
         unsafe { libc::feof(self.file) != 0 }
     }
 }
 
 impl Writer for CFile {
-    #[fixed_stack_segment] #[inline(never)]
     fn write(&mut self, buf: &[u8]) {
         let ret = do keep_going(buf) |buf, len| {
             unsafe {
@@ -196,7 +190,6 @@ impl Writer for CFile {
         }
     }
 
-    #[fixed_stack_segment] #[inline(never)]
     fn flush(&mut self) {
         if unsafe { libc::fflush(self.file) } < 0 {
             raise_error();
@@ -205,7 +198,6 @@ impl Writer for CFile {
 }
 
 impl Seek for CFile {
-    #[fixed_stack_segment] #[inline(never)]
     fn tell(&self) -> u64 {
         let ret = unsafe { libc::ftell(self.file) };
         if ret < 0 {
@@ -214,7 +206,6 @@ impl Seek for CFile {
         return ret as u64;
     }
 
-    #[fixed_stack_segment] #[inline(never)]
     fn seek(&mut self, pos: i64, style: SeekStyle) {
         let whence = match style {
             SeekSet => libc::SEEK_SET,
@@ -228,7 +219,6 @@ impl Seek for CFile {
 }
 
 impl Drop for CFile {
-    #[fixed_stack_segment] #[inline(never)]
     fn drop(&mut self) {
         unsafe { libc::fclose(self.file); }
     }
@@ -242,7 +232,6 @@ mod tests {
     use rt::io::{io_error, SeekSet};
     use super::*;
 
-    #[test] #[fixed_stack_segment]
     #[ignore(cfg(target_os = "freebsd"))] // hmm, maybe pipes have a tiny buffer
     fn test_file_desc() {
         // Run this test with some pipes so we don't have to mess around with
@@ -278,7 +267,6 @@ mod tests {
         }
     }
 
-    #[test] #[fixed_stack_segment]
     #[ignore(cfg(windows))] // apparently windows doesn't like tmpfile
     fn test_cfile() {
         unsafe {
@@ -358,7 +346,6 @@ mod old_os {
     #[cfg(unix)]
     /// Indicates whether a path represents a directory
     pub fn path_is_dir(p: &Path) -> bool {
-        #[fixed_stack_segment]; #[inline(never)];
         unsafe {
             do p.with_c_str |buf| {
                 rustrt::rust_path_is_dir(buf) != 0 as c_int
@@ -369,7 +356,6 @@ mod old_os {
 
     #[cfg(windows)]
     pub fn path_is_dir(p: &Path) -> bool {
-        #[fixed_stack_segment]; #[inline(never)];
         unsafe {
             do os::win32::as_utf16_p(p.as_str().unwrap()) |buf| {
                 rustrt::rust_path_is_dir_u16(buf) != 0 as c_int
@@ -380,7 +366,6 @@ mod old_os {
     #[cfg(unix)]
     /// Indicates whether a path exists
     pub fn path_exists(p: &Path) -> bool {
-        #[fixed_stack_segment]; #[inline(never)];
         unsafe {
             do p.with_c_str |buf| {
                 rustrt::rust_path_exists(buf) != 0 as c_int
@@ -390,7 +375,6 @@ mod old_os {
 
     #[cfg(windows)]
     pub fn path_exists(p: &Path) -> bool {
-        #[fixed_stack_segment]; #[inline(never)];
         unsafe {
             do os::win32::as_utf16_p(p.as_str().unwrap()) |buf| {
                 rustrt::rust_path_exists_u16(buf) != 0 as c_int
@@ -404,7 +388,6 @@ mod old_os {
 
         #[cfg(windows)]
         fn mkdir(p: &Path, _mode: c_int) -> bool {
-            #[fixed_stack_segment]; #[inline(never)];
             unsafe {
                 use os::win32::as_utf16_p;
                 // FIXME: turn mode into something useful? #2623
@@ -417,7 +400,6 @@ mod old_os {
 
         #[cfg(unix)]
         fn mkdir(p: &Path, mode: c_int) -> bool {
-            #[fixed_stack_segment]; #[inline(never)];
             do p.with_c_str |buf| {
                 unsafe {
                     libc::mkdir(buf, mode as libc::mode_t) == (0 as c_int)
@@ -457,7 +439,6 @@ mod old_os {
             #[cfg(target_os = "freebsd")]
             #[cfg(target_os = "macos")]
             unsafe fn get_list(p: &Path) -> ~[Path] {
-                #[fixed_stack_segment]; #[inline(never)];
                 use libc::{dirent_t};
                 use libc::{opendir, readdir, closedir};
                 extern {
@@ -488,7 +469,6 @@ mod old_os {
             }
             #[cfg(windows)]
             unsafe fn get_list(p: &Path) -> ~[Path] {
-                #[fixed_stack_segment]; #[inline(never)];
                 use libc::consts::os::extra::INVALID_HANDLE_VALUE;
                 use libc::{wcslen, free};
                 use libc::funcs::extra::kernel32::{
@@ -568,7 +548,6 @@ mod old_os {
 
         #[cfg(windows)]
         fn rmdir(p: &Path) -> bool {
-            #[fixed_stack_segment]; #[inline(never)];
             unsafe {
                 use os::win32::as_utf16_p;
                 return do as_utf16_p(p.as_str().unwrap()) |buf| {
@@ -579,7 +558,6 @@ mod old_os {
 
         #[cfg(unix)]
         fn rmdir(p: &Path) -> bool {
-            #[fixed_stack_segment]; #[inline(never)];
             do p.with_c_str |buf| {
                 unsafe {
                     libc::rmdir(buf) == (0 as c_int)
@@ -594,7 +572,6 @@ mod old_os {
 
         #[cfg(windows)]
         fn unlink(p: &Path) -> bool {
-            #[fixed_stack_segment]; #[inline(never)];
             unsafe {
                 use os::win32::as_utf16_p;
                 return do as_utf16_p(p.as_str().unwrap()) |buf| {
@@ -605,7 +582,6 @@ mod old_os {
 
         #[cfg(unix)]
         fn unlink(p: &Path) -> bool {
-            #[fixed_stack_segment]; #[inline(never)];
             unsafe {
                 do p.with_c_str |buf| {
                     libc::unlink(buf) == (0 as c_int)
@@ -616,7 +592,6 @@ mod old_os {
 
     /// Renames an existing file or directory
     pub fn rename_file(old: &Path, new: &Path) -> bool {
-        #[fixed_stack_segment]; #[inline(never)];
         unsafe {
            do old.with_c_str |old_buf| {
                 do new.with_c_str |new_buf| {
@@ -632,7 +607,6 @@ mod old_os {
 
         #[cfg(windows)]
         fn do_copy_file(from: &Path, to: &Path) -> bool {
-            #[fixed_stack_segment]; #[inline(never)];
             unsafe {
                 use os::win32::as_utf16_p;
                 return do as_utf16_p(from.as_str().unwrap()) |fromp| {
@@ -646,7 +620,6 @@ mod old_os {
 
         #[cfg(unix)]
         fn do_copy_file(from: &Path, to: &Path) -> bool {
-            #[fixed_stack_segment]; #[inline(never)];
             unsafe {
                 let istream = do from.with_c_str |fromp| {
                     do "rb".with_c_str |modebuf| {
diff --git a/src/libstd/rt/io/native/process.rs b/src/libstd/rt/io/native/process.rs
index f5c39de1bf4..9bf0ed63e8c 100644
--- a/src/libstd/rt/io/native/process.rs
+++ b/src/libstd/rt/io/native/process.rs
@@ -69,8 +69,6 @@ impl Process {
                stdin: Option<file::fd_t>,
                stdout: Option<file::fd_t>,
                stderr: Option<file::fd_t>) -> Process {
-        #[fixed_stack_segment]; #[inline(never)];
-
         let (in_pipe, in_fd) = match stdin {
             None => {
                 let pipe = os::pipe();
@@ -208,7 +206,6 @@ impl Process {
 
         #[cfg(windows)]
         unsafe fn killpid(pid: pid_t, signal: int) -> Result<(), io::IoError> {
-            #[fixed_stack_segment]; #[inline(never)];
             match signal {
                 io::process::PleaseExitSignal |
                 io::process::MustDieSignal => {
@@ -226,7 +223,6 @@ impl Process {
 
         #[cfg(not(windows))]
         unsafe fn killpid(pid: pid_t, signal: int) -> Result<(), io::IoError> {
-            #[fixed_stack_segment]; #[inline(never)];
             libc::funcs::posix88::signal::kill(pid, signal as c_int);
             Ok(())
         }
@@ -254,8 +250,6 @@ fn spawn_process_os(prog: &str, args: &[~str],
                     env: Option<~[(~str, ~str)]>,
                     dir: Option<&Path>,
                     in_fd: c_int, out_fd: c_int, err_fd: c_int) -> SpawnProcessResult {
-    #[fixed_stack_segment]; #[inline(never)];
-
     use libc::types::os::arch::extra::{DWORD, HANDLE, STARTUPINFO};
     use libc::consts::os::extra::{
         TRUE, FALSE,
@@ -439,8 +433,6 @@ fn spawn_process_os(prog: &str, args: &[~str],
                     env: Option<~[(~str, ~str)]>,
                     dir: Option<&Path>,
                     in_fd: c_int, out_fd: c_int, err_fd: c_int) -> SpawnProcessResult {
-    #[fixed_stack_segment]; #[inline(never)];
-
     use libc::funcs::posix88::unistd::{fork, dup2, close, chdir, execvp};
     use libc::funcs::bsd44::getdtablesize;
 
@@ -455,7 +447,7 @@ fn spawn_process_os(prog: &str, args: &[~str],
     unsafe fn set_environ(_envp: *c_void) {}
     #[cfg(target_os = "macos")]
     unsafe fn set_environ(envp: *c_void) {
-        externfn!(fn _NSGetEnviron() -> *mut *c_void);
+        extern { fn _NSGetEnviron() -> *mut *c_void; }
 
         *_NSGetEnviron() = envp;
     }
@@ -603,7 +595,6 @@ fn with_dirp<T>(d: Option<&Path>, cb: &fn(*libc::c_char) -> T) -> T {
 
 #[cfg(windows)]
 fn free_handle(handle: *()) {
-    #[fixed_stack_segment]; #[inline(never)];
     unsafe {
         libc::funcs::extra::kernel32::CloseHandle(cast::transmute(handle));
     }
@@ -629,8 +620,6 @@ fn waitpid(pid: pid_t) -> int {
 
     #[cfg(windows)]
     fn waitpid_os(pid: pid_t) -> int {
-        #[fixed_stack_segment]; #[inline(never)];
-
         use libc::types::os::arch::extra::DWORD;
         use libc::consts::os::extra::{
             SYNCHRONIZE,
@@ -676,8 +665,6 @@ fn waitpid(pid: pid_t) -> int {
 
     #[cfg(unix)]
     fn waitpid_os(pid: pid_t) -> int {
-        #[fixed_stack_segment]; #[inline(never)];
-
         use libc::funcs::posix01::wait::*;
 
         #[cfg(target_os = "linux")]
diff --git a/src/libstd/rt/io/signal.rs b/src/libstd/rt/io/signal.rs
index 9fe8cb3ed90..3f013d5cac9 100644
--- a/src/libstd/rt/io/signal.rs
+++ b/src/libstd/rt/io/signal.rs
@@ -154,7 +154,6 @@ mod test {
 
     // kill is only available on Unixes
     #[cfg(unix)]
-    #[fixed_stack_segment]
     fn sigint() {
         unsafe {
             libc::funcs::posix88::signal::kill(libc::getpid(), libc::SIGINT);
diff --git a/src/libstd/rt/io/stdio.rs b/src/libstd/rt/io/stdio.rs
index acc2e11f067..e829c77cec1 100644
--- a/src/libstd/rt/io/stdio.rs
+++ b/src/libstd/rt/io/stdio.rs
@@ -69,7 +69,6 @@ enum StdSource {
     File(~RtioFileStream),
 }
 
-#[fixed_stack_segment] #[inline(never)]
 fn src<T>(fd: libc::c_int, readable: bool, f: &fn(StdSource) -> T) -> T {
     do with_local_io |io| {
         let fd = unsafe { libc::dup(fd) };
@@ -91,7 +90,6 @@ fn src<T>(fd: libc::c_int, readable: bool, f: &fn(StdSource) -> T) -> T {
 /// Creates a new non-blocking handle to the stdin of the current process.
 ///
 /// See `stdout()` for notes about this function.
-#[fixed_stack_segment] #[inline(never)]
 pub fn stdin() -> StdReader {
     do src(libc::STDIN_FILENO, true) |src| { StdReader { inner: src } }
 }
diff --git a/src/libstd/rt/local_ptr.rs b/src/libstd/rt/local_ptr.rs
index c9534413c53..f35b657d9dd 100644
--- a/src/libstd/rt/local_ptr.rs
+++ b/src/libstd/rt/local_ptr.rs
@@ -26,8 +26,6 @@ use tls = rt::thread_local_storage;
 static mut RT_TLS_KEY: tls::Key = -1;
 
 /// Initialize the TLS key. Other ops will fail if this isn't executed first.
-#[fixed_stack_segment]
-#[inline(never)]
 pub fn init_tls_key() {
     unsafe {
         rust_initialize_rt_tls_key(&mut RT_TLS_KEY);
diff --git a/src/libstd/rt/logging.rs b/src/libstd/rt/logging.rs
index c37195a7b15..f346380ff7a 100644
--- a/src/libstd/rt/logging.rs
+++ b/src/libstd/rt/logging.rs
@@ -135,7 +135,6 @@ fn update_entry(dirs: &[LogDirective], entry: &ModEntry) -> u32 {
     if longest_match >= 0 { return 1; } else { return 0; }
 }
 
-#[fixed_stack_segment] #[inline(never)]
 /// Set log level for every entry in crate_map according to the sepecification
 /// in settings
 fn update_log_settings(crate_map: &CrateMap, settings: ~str) {
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs
index a5c0d3be044..f18b4dc4234 100644
--- a/src/libstd/rt/mod.rs
+++ b/src/libstd/rt/mod.rs
@@ -463,8 +463,6 @@ pub fn in_green_task_context() -> bool {
 }
 
 pub fn new_event_loop() -> ~rtio::EventLoop {
-    #[fixed_stack_segment]; #[allow(cstack)];
-
     match crate_map::get_crate_map() {
         None => {}
         Some(map) => {
diff --git a/src/libstd/rt/sched.rs b/src/libstd/rt/sched.rs
index c2e665f4903..f4e5811acd3 100644
--- a/src/libstd/rt/sched.rs
+++ b/src/libstd/rt/sched.rs
@@ -853,7 +853,6 @@ fn new_sched_rng() -> XorShiftRng {
     XorShiftRng::new()
 }
 #[cfg(unix)]
-#[fixed_stack_segment] #[inline(never)]
 fn new_sched_rng() -> XorShiftRng {
     use libc;
     use mem;
diff --git a/src/libstd/rt/stack.rs b/src/libstd/rt/stack.rs
index 55bd4b0732a..4358390da9f 100644
--- a/src/libstd/rt/stack.rs
+++ b/src/libstd/rt/stack.rs
@@ -21,8 +21,6 @@ pub struct StackSegment {
 
 impl StackSegment {
     pub fn new(size: uint) -> StackSegment {
-        #[fixed_stack_segment]; #[inline(never)];
-
         unsafe {
             // Crate a block of uninitialized values
             let mut stack = vec::with_capacity(size);
@@ -54,8 +52,6 @@ impl StackSegment {
 
 impl Drop for StackSegment {
     fn drop(&mut self) {
-        #[fixed_stack_segment]; #[inline(never)];
-
         unsafe {
             // XXX: Using the FFI to call a C macro. Slow
             rust_valgrind_stack_deregister(self.valgrind_id);
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs
index 7e374fc6021..7620a4371c1 100644
--- a/src/libstd/rt/task.rs
+++ b/src/libstd/rt/task.rs
@@ -509,7 +509,6 @@ impl Unwinder {
         }
 
         extern {
-            #[rust_stack]
             fn rust_try(f: extern "C" fn(*c_void, *c_void),
                         code: *c_void,
                         data: *c_void) -> uintptr_t;
@@ -517,8 +516,6 @@ impl Unwinder {
     }
 
     pub fn begin_unwind(&mut self, cause: ~Any) -> ! {
-        #[fixed_stack_segment]; #[inline(never)];
-
         self.unwinding = true;
         self.cause = Some(cause);
         unsafe {
@@ -537,9 +534,8 @@ impl Unwinder {
 /// truly consider it to be stack overflow rather than allocating a new stack.
 #[no_mangle]      // - this is called from C code
 #[no_split_stack] // - it would be sad for this function to trigger __morestack
-#[doc(hidden)] // XXX: this function shouldn't have to be `pub` to get exported
-               //      so it can be linked against, we should have a better way
-               //      of specifying that.
+#[doc(hidden)]    // - Function must be `pub` to get exported, but it's
+                  //   irrelevant for documentation purposes.
 pub extern "C" fn rust_stack_exhausted() {
     use rt::in_green_task_context;
     use rt::task::Task;
diff --git a/src/libstd/rt/test.rs b/src/libstd/rt/test.rs
index aa680cddf2a..3db9c049eb2 100644
--- a/src/libstd/rt/test.rs
+++ b/src/libstd/rt/test.rs
@@ -143,8 +143,6 @@ mod darwin_fd_limit {
     static RLIMIT_NOFILE: libc::c_int = 8;
 
     pub unsafe fn raise_fd_limit() {
-        #[fixed_stack_segment]; #[inline(never)];
-
         // The strategy here is to fetch the current resource limits, read the kern.maxfilesperproc
         // sysctl value, and bump the soft resource limit for maxfiles up to the sysctl value.
         use ptr::{to_unsafe_ptr, to_mut_unsafe_ptr, mut_null};
@@ -362,7 +360,6 @@ pub fn cleanup_task(mut task: ~Task) {
 }
 
 /// Get a port number, starting at 9600, for use in tests
-#[fixed_stack_segment] #[inline(never)]
 pub fn next_test_port() -> u16 {
     unsafe {
         return rust_dbg_next_port(base_port() as libc::uintptr_t) as u16;
@@ -373,7 +370,6 @@ pub fn next_test_port() -> u16 {
 }
 
 /// Get a temporary path which could be the location of a unix socket
-#[fixed_stack_segment] #[inline(never)]
 pub fn next_test_unix() -> Path {
     if cfg!(unix) {
         os::tmpdir().join(rand::task_rng().gen_ascii_str(20))
diff --git a/src/libstd/rt/thread.rs b/src/libstd/rt/thread.rs
index b21a8f5981d..5e535d994f9 100644
--- a/src/libstd/rt/thread.rs
+++ b/src/libstd/rt/thread.rs
@@ -68,8 +68,6 @@ impl Thread {
 #[cfg(windows)]
 fn native_thread_create(thread_start: extern "C" fn(*libc::c_void) -> rust_thread_return,
                         tramp: ~~fn()) -> rust_thread {
-    #[fixed_stack_segment];
-
     unsafe {
         let ptr: *mut libc::c_void = cast::transmute(tramp);
         CreateThread(ptr::mut_null(), DEFAULT_STACK_SIZE, thread_start, ptr, 0, ptr::mut_null())
@@ -78,7 +76,6 @@ fn native_thread_create(thread_start: extern "C" fn(*libc::c_void) -> rust_threa
 
 #[cfg(windows)]
 fn native_thread_join(native: rust_thread) {
-    #[fixed_stack_segment];
     use libc::consts::os::extra::INFINITE;
     unsafe { WaitForSingleObject(native, INFINITE); }
 }
@@ -86,8 +83,6 @@ fn native_thread_join(native: rust_thread) {
 #[cfg(unix)]
 fn native_thread_create(thread_start: extern "C" fn(*libc::c_void) -> rust_thread_return,
                         tramp: ~~fn()) -> rust_thread {
-    #[fixed_stack_segment];
-
     use unstable::intrinsics;
     let mut native: libc::pthread_t = unsafe { intrinsics::uninit() };
 
@@ -107,13 +102,11 @@ fn native_thread_create(thread_start: extern "C" fn(*libc::c_void) -> rust_threa
 
 #[cfg(unix)]
 fn native_thread_join(native: rust_thread) {
-    #[fixed_stack_segment];
     unsafe { assert!(pthread_join(native, ptr::null()) == 0) }
 }
 
 impl Drop for Thread {
     fn drop(&mut self) {
-        #[fixed_stack_segment]; #[inline(never)];
         assert!(self.joined);
     }
 }
diff --git a/src/libstd/rt/thread_local_storage.rs b/src/libstd/rt/thread_local_storage.rs
index 4ae1fe59a37..8fa64852846 100644
--- a/src/libstd/rt/thread_local_storage.rs
+++ b/src/libstd/rt/thread_local_storage.rs
@@ -20,8 +20,6 @@ use libc::types::os::arch::extra::{DWORD, LPVOID, BOOL};
 pub type Key = pthread_key_t;
 
 #[cfg(unix)]
-#[fixed_stack_segment]
-#[inline(never)]
 pub unsafe fn create(key: &mut Key) {
     assert_eq!(0, pthread_key_create(key, null()));
 }
@@ -49,20 +47,7 @@ type pthread_key_t = ::libc::c_uint;
 #[cfg(unix)]
 extern {
     fn pthread_key_create(key: *mut pthread_key_t, dtor: *u8) -> c_int;
-
-    // This function is a very cheap operation on both osx and unix. On osx, it
-    // turns out it's just three instructions, and on unix it's a cheap function
-    // which only uses a very small amount of stack.
-    //
-    // This is not marked as such because we think it has a small stack, but
-    // rather we would like to be able to fetch information from
-    // thread-local-storage when a task is running very low on its stack budget.
-    // For example, this is invoked whenever stack overflow is detected, and we
-    // obviously have very little budget to deal with (certainly not anything
-    // close to a fixed_stack_segment)
-    #[rust_stack]
     fn pthread_getspecific(key: pthread_key_t) -> *mut c_void;
-    #[rust_stack]
     fn pthread_setspecific(key: pthread_key_t, value: *mut c_void) -> c_int;
 }
 
@@ -70,8 +55,6 @@ extern {
 pub type Key = DWORD;
 
 #[cfg(windows)]
-#[fixed_stack_segment]
-#[inline(never)]
 pub unsafe fn create(key: &mut Key) {
     static TLS_OUT_OF_INDEXES: DWORD = 0xFFFFFFFF;
     *key = TlsAlloc();
@@ -91,13 +74,7 @@ pub unsafe fn get(key: Key) -> *mut c_void {
 #[cfg(windows)]
 extern "system" {
     fn TlsAlloc() -> DWORD;
-
-    // See the reasoning in pthread_getspecific as to why this has the
-    // 'rust_stack' attribute, as this function was also verified to only
-    // require a small amount of stack.
-    #[rust_stack]
     fn TlsGetValue(dwTlsIndex: DWORD) -> LPVOID;
-    #[rust_stack]
     fn TlsSetValue(dwTlsIndex: DWORD, lpTlsvalue: LPVOID) -> BOOL;
 }
 
diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs
index 070985fb0a5..50f73becef2 100644
--- a/src/libstd/rt/util.rs
+++ b/src/libstd/rt/util.rs
@@ -24,8 +24,6 @@ pub static ENFORCE_SANITY: bool = true || !cfg!(rtopt) || cfg!(rtdebug) || cfg!(
 
 /// Get the number of cores available
 pub fn num_cpus() -> uint {
-    #[fixed_stack_segment]; #[inline(never)];
-
     unsafe {
         return rust_get_num_cpus();
     }
@@ -146,7 +144,6 @@ memory and partly incapable of presentation to others.",
     abort();
 
     fn abort() -> ! {
-        #[fixed_stack_segment]; #[inline(never)];
         unsafe { libc::abort() }
     }
 }