diff options
| -rw-r--r-- | Cargo.lock | 19 | ||||
| -rw-r--r-- | Cargo.toml | 1 | ||||
| -rw-r--r-- | crates/shirabe/Cargo.toml | 1 | ||||
| -rw-r--r-- | crates/shirabe/src/lib.rs | 4 |
4 files changed, 25 insertions, 0 deletions
@@ -1343,6 +1343,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] +name = "libmimalloc-sys" +version = "0.1.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a45a52f43e1c16f667ccfe4dd8c85b7f7c204fd5e3bf46c5b0db9a5c3c0b8e9" +dependencies = [ + "cc", +] + +[[package]] name = "linux-raw-sys" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1412,6 +1421,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a86d3146ed3995b5913c414f6664344b9617457320782e64f0bb44afd49d74" [[package]] +name = "mimalloc" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d4139bb28d14ad1facf21d5eb8825051b326e172d216b39f6d31df53cc97862" +dependencies = [ + "libmimalloc-sys", +] + +[[package]] name = "mime" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2326,6 +2344,7 @@ dependencies = [ "indexmap", "jsonschema", "md5", + "mimalloc", "mockall", "nix", "regex", @@ -38,6 +38,7 @@ indexmap = { version = "2.14.0", features = ["serde"] } jsonschema = { version = "0.46.6", default-features = false } md5 = "0.7.0" memchr = "2.8.3" +mimalloc = "0.1.52" mockall = "0.14.0" nix = { version = "0.31.3", features = ["feature", "fs", "poll", "process", "signal", "user"] } regex = "1.12.3" diff --git a/crates/shirabe/Cargo.toml b/crates/shirabe/Cargo.toml index 66f2b5fc..653591d4 100644 --- a/crates/shirabe/Cargo.toml +++ b/crates/shirabe/Cargo.toml @@ -29,6 +29,7 @@ futures.workspace = true indexmap.workspace = true jsonschema.workspace = true md5.workspace = true +mimalloc.workspace = true nix.workspace = true regex.workspace = true reqwest.workspace = true diff --git a/crates/shirabe/src/lib.rs b/crates/shirabe/src/lib.rs index 9daf2188..3b142e74 100644 --- a/crates/shirabe/src/lib.rs +++ b/crates/shirabe/src/lib.rs @@ -25,6 +25,10 @@ pub mod self_update; pub mod signal; pub mod util; +// Declared here to use this allocator in all binaries including tests and benches. +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + // InstalledVersions is intentionally unported to Rust. It is a runtime API for plugins and project // code, never read by Composer itself. Its real state is stored in PHP's InstalledVersions class. // See also `__shirabe_installed_versions_reload` in crates/shirabe-php-rpc/php/worker.php. |
