From 7755ffd0131fa99ca5d58bdd5eab443b44d5a1ff Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 6 Nov 2013 15:16:04 -0800 Subject: 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 --- src/libextra/c_vec.rs | 4 ---- src/libextra/flate.rs | 4 ---- src/libextra/lib.rs | 2 ++ src/libextra/test.rs | 2 -- src/libextra/time.rs | 13 ------------- 5 files changed, 2 insertions(+), 23 deletions(-) (limited to 'src/libextra') diff --git a/src/libextra/c_vec.rs b/src/libextra/c_vec.rs index bd3ce20742e..205e0be41cb 100644 --- a/src/libextra/c_vec.rs +++ b/src/libextra/c_vec.rs @@ -162,7 +162,6 @@ mod tests { } impl Runnable for LibcFree { - #[fixed_stack_segment] fn run(~self) { unsafe { libc::free(self.mem) @@ -171,9 +170,6 @@ mod tests { } fn malloc(n: size_t) -> CVec { - #[fixed_stack_segment]; - #[inline(never)]; - unsafe { let mem = libc::malloc(n); diff --git a/src/libextra/flate.rs b/src/libextra/flate.rs index 3f3b588e8bc..83a3ef60a8a 100644 --- a/src/libextra/flate.rs +++ b/src/libextra/flate.rs @@ -47,8 +47,6 @@ static TINFL_FLAG_PARSE_ZLIB_HEADER : c_int = 0x1; // parse zlib header and adle static TDEFL_WRITE_ZLIB_HEADER : c_int = 0x01000; // write zlib header and adler32 checksum fn deflate_bytes_internal(bytes: &[u8], flags: c_int) -> ~[u8] { - #[fixed_stack_segment]; #[inline(never)]; - do bytes.as_imm_buf |b, len| { unsafe { let mut outsz : size_t = 0; @@ -75,8 +73,6 @@ pub fn deflate_bytes_zlib(bytes: &[u8]) -> ~[u8] { } fn inflate_bytes_internal(bytes: &[u8], flags: c_int) -> ~[u8] { - #[fixed_stack_segment]; #[inline(never)]; - do bytes.as_imm_buf |b, len| { unsafe { let mut outsz : size_t = 0; diff --git a/src/libextra/lib.rs b/src/libextra/lib.rs index a74c4993be3..106dc5bf5c9 100644 --- a/src/libextra/lib.rs +++ b/src/libextra/lib.rs @@ -38,6 +38,8 @@ Rust extras are part of the standard Rust distribution. #[deny(non_camel_case_types)]; #[deny(missing_doc)]; +#[allow(unrecognized_lint)]; // NOTE: remove after the next snapshot +#[allow(cstack)]; // NOTE: remove after the next snapshot. use std::str::{StrSlice, OwnedStr}; diff --git a/src/libextra/test.rs b/src/libextra/test.rs index 4cdb3841acf..04f045c961f 100644 --- a/src/libextra/test.rs +++ b/src/libextra/test.rs @@ -220,8 +220,6 @@ fn optgroups() -> ~[getopts::groups::OptGroup] { } fn usage(binary: &str, helpstr: &str) { - #[fixed_stack_segment]; #[inline(never)]; - let message = format!("Usage: {} [OPTIONS] [FILTER]", binary); println(groups::usage(message, optgroups())); println(""); diff --git a/src/libextra/time.rs b/src/libextra/time.rs index eff0da96bff..aed42e8d7fe 100644 --- a/src/libextra/time.rs +++ b/src/libextra/time.rs @@ -63,8 +63,6 @@ impl Ord for Timespec { * nanoseconds since 1970-01-01T00:00:00Z. */ pub fn get_time() -> Timespec { - #[fixed_stack_segment]; #[inline(never)]; - unsafe { let mut sec = 0i64; let mut nsec = 0i32; @@ -79,8 +77,6 @@ pub fn get_time() -> Timespec { * in nanoseconds since an unspecified epoch. */ pub fn precise_time_ns() -> u64 { - #[fixed_stack_segment]; #[inline(never)]; - unsafe { let mut ns = 0u64; rustrt::precise_time_ns(&mut ns); @@ -98,8 +94,6 @@ pub fn precise_time_s() -> f64 { } pub fn tzset() { - #[fixed_stack_segment]; #[inline(never)]; - unsafe { rustrt::rust_tzset(); } @@ -143,8 +137,6 @@ pub fn empty_tm() -> Tm { /// Returns the specified time in UTC pub fn at_utc(clock: Timespec) -> Tm { - #[fixed_stack_segment]; #[inline(never)]; - unsafe { let Timespec { sec, nsec } = clock; let mut tm = empty_tm(); @@ -160,8 +152,6 @@ pub fn now_utc() -> Tm { /// Returns the specified time in the local timezone pub fn at(clock: Timespec) -> Tm { - #[fixed_stack_segment]; #[inline(never)]; - unsafe { let Timespec { sec, nsec } = clock; let mut tm = empty_tm(); @@ -179,8 +169,6 @@ pub fn now() -> Tm { impl Tm { /// Convert time to the seconds from January 1, 1970 pub fn to_timespec(&self) -> Timespec { - #[fixed_stack_segment]; #[inline(never)]; - unsafe { let sec = match self.tm_gmtoff { 0_i32 => rustrt::rust_timegm(self), @@ -969,7 +957,6 @@ mod tests { use std::libc; #[cfg(windows)] - #[fixed_stack_segment] fn set_time_zone() { // Windows crt doesn't see any environment variable set by // `SetEnvironmentVariable`, which `os::setenv` internally uses. -- cgit 1.4.1-3-g733a5