aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/shirabe/Cargo.toml1
-rw-r--r--crates/shirabe/src/lib.rs4
2 files changed, 5 insertions, 0 deletions
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.