aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_prof/Cargo.toml2
-rw-r--r--crates/ra_prof/src/lib.rs4
-rw-r--r--crates/rust-analyzer/Cargo.toml1
3 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_prof/Cargo.toml b/crates/ra_prof/Cargo.toml
index 69ac51c9e..b3d52985a 100644
--- a/crates/ra_prof/Cargo.toml
+++ b/crates/ra_prof/Cargo.toml
@@ -13,6 +13,7 @@ doctest = false
13ra_arena = { path = "../ra_arena" } 13ra_arena = { path = "../ra_arena" }
14once_cell = "1.3.1" 14once_cell = "1.3.1"
15backtrace = { version = "0.3.44", optional = true } 15backtrace = { version = "0.3.44", optional = true }
16mimalloc = { version = "0.1.19", default-features = false, optional = true }
16 17
17[target.'cfg(not(target_env = "msvc"))'.dependencies] 18[target.'cfg(not(target_env = "msvc"))'.dependencies]
18jemallocator = { version = "0.3.2", optional = true } 19jemallocator = { version = "0.3.2", optional = true }
@@ -25,4 +26,5 @@ cpu_profiler = []
25# Uncomment to enable for the whole crate graph 26# Uncomment to enable for the whole crate graph
26# default = [ "backtrace" ] 27# default = [ "backtrace" ]
27# default = [ "jemalloc" ] 28# default = [ "jemalloc" ]
29# default = [ "mimalloc" ]
28# default = [ "cpu_profiler" ] 30# default = [ "cpu_profiler" ]
diff --git a/crates/ra_prof/src/lib.rs b/crates/ra_prof/src/lib.rs
index 7163a8424..b54531b4e 100644
--- a/crates/ra_prof/src/lib.rs
+++ b/crates/ra_prof/src/lib.rs
@@ -19,6 +19,10 @@ pub use crate::{
19#[global_allocator] 19#[global_allocator]
20static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; 20static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
21 21
22#[cfg(all(feature = "mimalloc"))]
23#[global_allocator]
24static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
25
22/// Prints backtrace to stderr, useful for debugging. 26/// Prints backtrace to stderr, useful for debugging.
23#[cfg(feature = "backtrace")] 27#[cfg(feature = "backtrace")]
24pub fn print_backtrace() { 28pub fn print_backtrace() {
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index 370b13090..57724bcbc 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -66,3 +66,4 @@ tt = { path = "../ra_tt", package = "ra_tt" }
66 66
67[features] 67[features]
68jemalloc = [ "ra_prof/jemalloc" ] 68jemalloc = [ "ra_prof/jemalloc" ]
69mimalloc = [ "ra_prof/mimalloc" ]