about summary refs log tree commit diff
path: root/src/libstd/rt/util.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-07-27 16:10:59 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-07-27 16:21:15 -0700
commitcf1ff56f3c8a7a55fa38bcdda3907147d25382a2 (patch)
tree29daf941fb2f83ac179a8700aa4d73487812ba0e /src/libstd/rt/util.rs
parent3e6b03c2d87a1f54bfde2ea82b1f85aa4df04909 (diff)
downloadrust-cf1ff56f3c8a7a55fa38bcdda3907147d25382a2.tar.gz
rust-cf1ff56f3c8a7a55fa38bcdda3907147d25382a2.zip
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.
Diffstat (limited to 'src/libstd/rt/util.rs')
-rw-r--r--src/libstd/rt/util.rs32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/libstd/rt/util.rs b/src/libstd/rt/util.rs
index 031fda089c8..0fe8d873a75 100644
--- a/src/libstd/rt/util.rs
+++ b/src/libstd/rt/util.rs
@@ -16,38 +16,6 @@ use intrinsics;
 use sync::atomic::{self, Ordering};
 use sys::stdio::Stderr;
 
-/// Dynamically inquire about whether we're running under V.
-/// You should usually not use this unless your test definitely
-/// can't run correctly un-altered. Valgrind is there to help
-/// you notice weirdness in normal, un-doctored code paths!
-pub fn running_on_valgrind() -> bool {
-    return on_valgrind();
-    #[cfg(windows)]
-    fn on_valgrind() -> bool { false }
-
-    #[cfg(unix)]
-    fn on_valgrind() -> bool {
-        use libc::uintptr_t;
-        extern {
-            fn rust_running_on_valgrind() -> uintptr_t;
-        }
-        unsafe { rust_running_on_valgrind() != 0 }
-    }
-}
-
-/// Valgrind has a fixed-sized array (size around 2000) of segment descriptors
-/// wired into it; this is a hard limit and requires rebuilding valgrind if you
-/// want to go beyond it. Normally this is not a problem, but in some tests, we
-/// produce a lot of threads casually.  Making lots of threads alone might not
-/// be a problem _either_, except on OSX, the segments produced for new threads
-/// _take a while_ to get reclaimed by the OS. Combined with the fact that libuv
-/// schedulers fork off a separate thread for polling fsevents on OSX, we get a
-/// perfect storm of creating "too many mappings" for valgrind to handle when
-/// running certain stress tests in the runtime.
-pub fn limit_thread_creation_due_to_osx_and_valgrind() -> bool {
-    (cfg!(target_os="macos")) && running_on_valgrind()
-}
-
 pub fn min_stack() -> usize {
     static MIN: atomic::AtomicUsize = atomic::AtomicUsize::new(0);
     match MIN.load(Ordering::SeqCst) {