diff --git a/Cargo.lock b/Cargo.lock index 47e5296..0a22903 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,6 +79,12 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "cc" +version = "1.0.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" + [[package]] name = "cfg-if" version = "0.1.9" @@ -128,6 +134,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "cmake" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e56268c17a6248366d66d4a47a3381369d068cce8409bb1716ed77ea32163bb" +dependencies = [ + "cc", +] + [[package]] name = "codebase_files" version = "0.1.0" @@ -329,6 +344,15 @@ version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0" +[[package]] +name = "libmimalloc-sys" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a27252ec1d0c4e0dd6142cbc572da50b363ab56fc334f7aa8fadf295b2e24e74" +dependencies = [ + "cmake", +] + [[package]] name = "linked-hash-map" version = "0.5.2" @@ -356,6 +380,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "mimalloc" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c52de2069999f01bd26436564dbe7de3a87898feeb7a0d0ff9eb20a05bb7ca0" +dependencies = [ + "libmimalloc-sys", +] + [[package]] name = "nodrop" version = "0.1.14" @@ -723,6 +756,7 @@ version = "0.1.0" dependencies = [ "cli", "codebase_files", + "mimalloc", "read_ctags", "serde_json", "token_search", diff --git a/Cargo.toml b/Cargo.toml index 445888a..994c284 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ read_ctags = { path = "crates/read_ctags/" } token_search = { path = "crates/token_search/" } codebase_files = { path = "crates/codebase_files/" } cli = { path = "crates/cli/" } +mimalloc = { version = "*", default-features = false } [[bin]] name = "read-ctags-rs" diff --git a/src/bin/unused.rs b/src/bin/unused.rs index 3d2f7dd..b16dde4 100644 --- a/src/bin/unused.rs +++ b/src/bin/unused.rs @@ -1,3 +1,6 @@ +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + use cli; fn main() {