From 9b5fa1c61a85972da419aa29d61286cb9e268f83 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 18 Jan 2021 19:25:55 +0100 Subject: Add back jemalloc support --- xtask/src/install.rs | 2 ++ xtask/src/main.rs | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'xtask/src') diff --git a/xtask/src/install.rs b/xtask/src/install.rs index 12962bcfa..202c74426 100644 --- a/xtask/src/install.rs +++ b/xtask/src/install.rs @@ -67,6 +67,7 @@ pub struct ServerOpt { pub enum Malloc { System, Mimalloc, + Jemalloc, } impl InstallCmd { @@ -176,6 +177,7 @@ fn install_server(opts: ServerOpt) -> Result<()> { let features = match opts.malloc { Malloc::System => &[][..], Malloc::Mimalloc => &["--features", "mimalloc"], + Malloc::Jemalloc => &["--features", "jemalloc"], }; let cmd = cmd!("cargo install --path crates/rust-analyzer --locked --force {features...}"); diff --git a/xtask/src/main.rs b/xtask/src/main.rs index dec48629c..c3e5c7326 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -49,7 +49,8 @@ FLAGS: --client[=CLIENT] Install only VS Code plugin. CLIENT is one of 'code', 'code-exploration', 'code-insiders', 'codium', or 'code-oss' --server Install only the language server - --mimalloc Use mimalloc for server + --mimalloc Use mimalloc allocator for server + --jemalloc Use jemalloc allocator for server -h, --help Prints help information " ); @@ -65,8 +66,13 @@ FLAGS: return Ok(()); } - let malloc = - if args.contains("--mimalloc") { Malloc::Mimalloc } else { Malloc::System }; + let malloc = if args.contains("--mimalloc") { + Malloc::Mimalloc + } else if args.contains("--jemalloc") { + Malloc::Jemalloc + } else { + Malloc::System + }; let client_opt = args.opt_value_from_str("--client")?; -- cgit v1.2.3