diff --git a/Cargo.lock b/Cargo.lock index 13f0819a0..fcdfb69c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,6 +110,7 @@ dependencies = [ "lazy_static", "libc", "log", + "mimalloc", "pretty_assertions", "pretty_env_logger", "regex", @@ -178,6 +179,15 @@ version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" +[[package]] +name = "libmimalloc-sys" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1b8479c593dba88c2741fc50b92e13dbabbbe0bd504d979f244ccc1a5b1c01" +dependencies = [ + "cc", +] + [[package]] name = "log" version = "0.4.14" @@ -193,6 +203,15 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +[[package]] +name = "mimalloc" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb74897ce508e6c49156fd1476fc5922cbc6e75183c65e399c765a09122e5130" +dependencies = [ + "libmimalloc-sys", +] + [[package]] name = "output_vt100" version = "0.1.2" diff --git a/Cargo.toml b/Cargo.toml index f8eb05662..74bd0f46c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,7 @@ tree-sitter = "0.19.5" libc = "0.2.99" log = "0.4.14" pretty_env_logger = "0.4.0" +mimalloc = { version = "0.1.26", default-features = false } [dev-dependencies] pretty_assertions = "0.6.1" diff --git a/src/main.rs b/src/main.rs index 74e33d64a..007612e0a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,8 @@ +use mimalloc::MiMalloc; + +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; + mod dijkstra; mod files; mod graph;