Setup global allocator in the correct crate

It worked before, but was roundabout
This commit is contained in:
Aleksey Kladov 2020-07-22 13:42:53 +02:00
parent deed44a472
commit 9ad41eb908
5 changed files with 6 additions and 10 deletions

View file

@ -29,6 +29,7 @@ serde = { version = "1.0.106", features = ["derive"] }
serde_json = "1.0.48"
threadpool = "1.7.1"
rayon = "1.3.1"
mimalloc = { version = "0.1.19", default-features = false, optional = true }
stdx = { path = "../stdx" }
@ -62,6 +63,3 @@ expect = { path = "../expect" }
test_utils = { path = "../test_utils" }
mbe = { path = "../ra_mbe", package = "ra_mbe" }
tt = { path = "../ra_tt", package = "ra_tt" }
[features]
mimalloc = [ "ra_prof/mimalloc" ]

View file

@ -16,6 +16,10 @@ use vfs::AbsPathBuf;
use crate::args::HelpPrinted;
#[cfg(all(feature = "mimalloc"))]
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
fn main() -> Result<()> {
setup_logging()?;
let args = match args::Args::parse()? {