aboutsummaryrefslogtreecommitdiff
path: root/xtask/src
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-01-18 18:25:55 +0000
committerJonas Schievink <[email protected]>2021-01-18 18:39:46 +0000
commit9b5fa1c61a85972da419aa29d61286cb9e268f83 (patch)
tree29704f0e4140261ed68bb5ea3cf52e7385bfc997 /xtask/src
parent6764d790ac904533dc7618fd38724a135499f87c (diff)
Add back jemalloc support
Diffstat (limited to 'xtask/src')
-rw-r--r--xtask/src/install.rs2
-rw-r--r--xtask/src/main.rs12
2 files changed, 11 insertions, 3 deletions
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 {
67pub enum Malloc { 67pub enum Malloc {
68 System, 68 System,
69 Mimalloc, 69 Mimalloc,
70 Jemalloc,
70} 71}
71 72
72impl InstallCmd { 73impl InstallCmd {
@@ -176,6 +177,7 @@ fn install_server(opts: ServerOpt) -> Result<()> {
176 let features = match opts.malloc { 177 let features = match opts.malloc {
177 Malloc::System => &[][..], 178 Malloc::System => &[][..],
178 Malloc::Mimalloc => &["--features", "mimalloc"], 179 Malloc::Mimalloc => &["--features", "mimalloc"],
180 Malloc::Jemalloc => &["--features", "jemalloc"],
179 }; 181 };
180 182
181 let cmd = cmd!("cargo install --path crates/rust-analyzer --locked --force {features...}"); 183 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:
49 --client[=CLIENT] Install only VS Code plugin. 49 --client[=CLIENT] Install only VS Code plugin.
50 CLIENT is one of 'code', 'code-exploration', 'code-insiders', 'codium', or 'code-oss' 50 CLIENT is one of 'code', 'code-exploration', 'code-insiders', 'codium', or 'code-oss'
51 --server Install only the language server 51 --server Install only the language server
52 --mimalloc Use mimalloc for server 52 --mimalloc Use mimalloc allocator for server
53 --jemalloc Use jemalloc allocator for server
53 -h, --help Prints help information 54 -h, --help Prints help information
54 " 55 "
55 ); 56 );
@@ -65,8 +66,13 @@ FLAGS:
65 return Ok(()); 66 return Ok(());
66 } 67 }
67 68
68 let malloc = 69 let malloc = if args.contains("--mimalloc") {
69 if args.contains("--mimalloc") { Malloc::Mimalloc } else { Malloc::System }; 70 Malloc::Mimalloc
71 } else if args.contains("--jemalloc") {
72 Malloc::Jemalloc
73 } else {
74 Malloc::System
75 };
70 76
71 let client_opt = args.opt_value_from_str("--client")?; 77 let client_opt = args.opt_value_from_str("--client")?;
72 78