Skip to content

Commit cf1ff56

Browse files
committed
std: Remove msvc/valgrind headers
These aren't really used for anything any more, so there doesn't seem to be much reason to leave them around in the `rt` directory. There was some limiting of threads spawned or tests when run under valgrind, but very little is run under valgrind nowadays so there's also no real use keeping these around.
1 parent 3e6b03c commit cf1ff56

File tree

11 files changed

+4
-6410
lines changed

11 files changed

+4
-6410
lines changed

.gitattributes

-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66
*.rs rust
77
src/etc/pkg/rust-logo.ico binary
88
src/etc/pkg/rust-logo.png binary
9-
src/rt/msvc/* -whitespace
10-
src/rt/valgrind/* -whitespace
119
*.woff binary

src/libstd/process.rs

+2-11
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,6 @@ mod tests {
591591
use io::prelude::*;
592592

593593
use io::ErrorKind;
594-
use rt::running_on_valgrind;
595594
use str;
596595
use super::{Command, Output, Stdio};
597596

@@ -737,10 +736,7 @@ mod tests {
737736

738737
assert!(status.success());
739738
assert_eq!(output_str.trim().to_string(), "hello");
740-
// FIXME #7224
741-
if !running_on_valgrind() {
742-
assert_eq!(stderr, Vec::new());
743-
}
739+
assert_eq!(stderr, Vec::new());
744740
}
745741

746742
#[cfg(not(target_os="android"))]
@@ -779,10 +775,7 @@ mod tests {
779775

780776
assert!(status.success());
781777
assert_eq!(output_str.trim().to_string(), "hello");
782-
// FIXME #7224
783-
if !running_on_valgrind() {
784-
assert_eq!(stderr, Vec::new());
785-
}
778+
assert_eq!(stderr, Vec::new());
786779
}
787780

788781
#[cfg(all(unix, not(target_os="android")))]
@@ -807,7 +800,6 @@ mod tests {
807800
#[test]
808801
fn test_inherit_env() {
809802
use std::env;
810-
if running_on_valgrind() { return; }
811803

812804
let result = env_cmd().output().unwrap();
813805
let output = String::from_utf8(result.stdout).unwrap();
@@ -824,7 +816,6 @@ mod tests {
824816
#[test]
825817
fn test_inherit_env() {
826818
use std::env;
827-
if running_on_valgrind() { return; }
828819

829820
let mut result = env_cmd().output().unwrap();
830821
let output = String::from_utf8(result.stdout).unwrap();

src/libstd/rt/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use sys;
2626
use usize;
2727

2828
// Reexport some of our utilities which are expected by other crates.
29-
pub use self::util::{min_stack, running_on_valgrind};
29+
pub use self::util::min_stack;
3030
pub use self::unwind::{begin_unwind, begin_unwind_fmt};
3131

3232
// Reexport some functionality from liballoc.

src/libstd/rt/util.rs

-32
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,6 @@ use intrinsics;
1616
use sync::atomic::{self, Ordering};
1717
use sys::stdio::Stderr;
1818

19-
/// Dynamically inquire about whether we're running under V.
20-
/// You should usually not use this unless your test definitely
21-
/// can't run correctly un-altered. Valgrind is there to help
22-
/// you notice weirdness in normal, un-doctored code paths!
23-
pub fn running_on_valgrind() -> bool {
24-
return on_valgrind();
25-
#[cfg(windows)]
26-
fn on_valgrind() -> bool { false }
27-
28-
#[cfg(unix)]
29-
fn on_valgrind() -> bool {
30-
use libc::uintptr_t;
31-
extern {
32-
fn rust_running_on_valgrind() -> uintptr_t;
33-
}
34-
unsafe { rust_running_on_valgrind() != 0 }
35-
}
36-
}
37-
38-
/// Valgrind has a fixed-sized array (size around 2000) of segment descriptors
39-
/// wired into it; this is a hard limit and requires rebuilding valgrind if you
40-
/// want to go beyond it. Normally this is not a problem, but in some tests, we
41-
/// produce a lot of threads casually. Making lots of threads alone might not
42-
/// be a problem _either_, except on OSX, the segments produced for new threads
43-
/// _take a while_ to get reclaimed by the OS. Combined with the fact that libuv
44-
/// schedulers fork off a separate thread for polling fsevents on OSX, we get a
45-
/// perfect storm of creating "too many mappings" for valgrind to handle when
46-
/// running certain stress tests in the runtime.
47-
pub fn limit_thread_creation_due_to_osx_and_valgrind() -> bool {
48-
(cfg!(target_os="macos")) && running_on_valgrind()
49-
}
50-
5119
pub fn min_stack() -> usize {
5220
static MIN: atomic::AtomicUsize = atomic::AtomicUsize::new(0);
5321
match MIN.load(Ordering::SeqCst) {

src/libtest/lib.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#![feature(fnbox)]
4242
#![feature(iter_cmp)]
4343
#![feature(libc)]
44-
#![feature(rt)]
4544
#![feature(rustc_private)]
4645
#![feature(set_stdio)]
4746
#![feature(staged_api)]
@@ -879,13 +878,7 @@ fn get_concurrency() -> usize {
879878
_ => panic!("RUST_TEST_THREADS is `{}`, should be a positive integer.", s)
880879
}
881880
}
882-
Err(..) => {
883-
if std::rt::util::limit_thread_creation_due_to_osx_and_valgrind() {
884-
1
885-
} else {
886-
num_cpus()
887-
}
888-
}
881+
Err(..) => num_cpus(),
889882
};
890883

891884
#[cfg(windows)]

0 commit comments

Comments
 (0)