mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Add opt-in mimalloc feature
This commit is contained in:
parent
46d4487b89
commit
6710856c10
6 changed files with 60 additions and 6 deletions
|
@ -19,7 +19,13 @@ pub enum ClientOpt {
|
|||
}
|
||||
|
||||
pub struct ServerOpt {
|
||||
pub jemalloc: bool,
|
||||
pub malloc: Malloc,
|
||||
}
|
||||
|
||||
pub enum Malloc {
|
||||
System,
|
||||
Jemalloc,
|
||||
Mimalloc,
|
||||
}
|
||||
|
||||
impl InstallCmd {
|
||||
|
@ -130,8 +136,12 @@ fn install_server(opts: ServerOpt) -> Result<()> {
|
|||
)
|
||||
}
|
||||
|
||||
let jemalloc = if opts.jemalloc { "--features jemalloc" } else { "" };
|
||||
let res = run!("cargo install --path crates/rust-analyzer --locked --force {}", jemalloc);
|
||||
let malloc_feature = match opts.malloc {
|
||||
Malloc::System => "",
|
||||
Malloc::Jemalloc => "--features jemalloc",
|
||||
Malloc::Mimalloc => "--features mimalloc",
|
||||
};
|
||||
let res = run!("cargo install --path crates/rust-analyzer --locked --force {}", malloc_feature);
|
||||
|
||||
if res.is_err() && old_rust {
|
||||
eprintln!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue