about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2018-12-24 13:29:32 +0100
committerGitHub <noreply@github.com>2018-12-24 13:29:32 +0100
commita0538c8f79c70cfa7a59412d5bb7664ada023c81 (patch)
treecbdd4fad94f059fe5247a18c9795ecab0cc8a559 /src
parent51f90a1313086ddc82c6f60b43dfe9607ef0ba2d (diff)
parentba0ed5b13f23dd6e4ff0047a653ee615b84a67f2 (diff)
downloadrust-a0538c8f79c70cfa7a59412d5bb7664ada023c81.tar.gz
rust-a0538c8f79c70cfa7a59412d5bb7664ada023c81.zip
Rollup merge of #56986 - alexcrichton:move-jemalloc, r=Mark-Simulacrum
rustc: Move jemalloc from rustc_driver to rustc

This commit moves jemalloc to just the rustc binary rather than the
rustc_driver shared library, enusring that it's only used for binaries
that opt-in to it like rustc rather than other binaries using
librustc_driver like rustdoc/rls/etc. This will hopefully address #56980
Diffstat (limited to 'src')
-rw-r--r--src/librustc_driver/Cargo.toml5
-rw-r--r--src/librustc_driver/lib.rs8
-rw-r--r--src/rustc/Cargo.toml7
-rw-r--r--src/rustc/rustc.rs8
4 files changed, 14 insertions, 14 deletions
diff --git a/src/librustc_driver/Cargo.toml b/src/librustc_driver/Cargo.toml
index 0356cc9bd54..8bcda409e66 100644
--- a/src/librustc_driver/Cargo.toml
+++ b/src/librustc_driver/Cargo.toml
@@ -38,8 +38,3 @@ syntax = { path = "../libsyntax" }
 smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
 syntax_ext = { path = "../libsyntax_ext" }
 syntax_pos = { path = "../libsyntax_pos" }
-
-[dependencies.jemalloc-sys]
-version = '0.1.8'
-optional = true
-features = ['unprefixed_malloc_on_supported_platforms']
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index bb9a7209642..b56ae61227c 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -63,14 +63,6 @@ extern crate syntax;
 extern crate syntax_ext;
 extern crate syntax_pos;
 
-// Note that the linkage here should be all that we need, on Linux we're not
-// prefixing the symbols here so this should naturally override our default
-// allocator. On OSX it should override via the zone allocator. We shouldn't
-// enable this by default on other platforms, so other platforms aren't handled
-// here yet.
-#[cfg(feature = "jemalloc-sys")]
-extern crate jemalloc_sys;
-
 use driver::CompileController;
 use pretty::{PpMode, UserIdentifiedItem};
 
diff --git a/src/rustc/Cargo.toml b/src/rustc/Cargo.toml
index 32969d09e85..164a3c6ad0d 100644
--- a/src/rustc/Cargo.toml
+++ b/src/rustc/Cargo.toml
@@ -15,5 +15,10 @@ rustc_driver = { path = "../librustc_driver" }
 # crate is intended to be used by codegen backends, which may not be in-tree.
 rustc_codegen_ssa = { path = "../librustc_codegen_ssa" }
 
+[dependencies.jemalloc-sys]
+version = '0.1.8'
+optional = true
+features = ['unprefixed_malloc_on_supported_platforms']
+
 [features]
-jemalloc = ['rustc_driver/jemalloc-sys']
+jemalloc = ['jemalloc-sys']
diff --git a/src/rustc/rustc.rs b/src/rustc/rustc.rs
index ab5a7c3f747..1c1c7b4bb8e 100644
--- a/src/rustc/rustc.rs
+++ b/src/rustc/rustc.rs
@@ -23,6 +23,14 @@ extern {}
 
 extern crate rustc_driver;
 
+// Note that the linkage here should be all that we need, on Linux we're not
+// prefixing the symbols here so this should naturally override our default
+// allocator. On OSX it should override via the zone allocator. We shouldn't
+// enable this by default on other platforms, so other platforms aren't handled
+// here yet.
+#[cfg(feature = "jemalloc-sys")]
+extern crate jemalloc_sys;
+
 fn main() {
     rustc_driver::set_sigpipe_handler();
     rustc_driver::main()