This is an automated email from the ASF dual-hosted git repository.

hubcio pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iggy.git


The following commit(s) were added to refs/heads/master by this push:
     new 03f5b3034 fix(server): restore the mimalloc global allocator (#3971)
03f5b3034 is described below

commit 03f5b3034b370825a3cf4fd5a5187b42568e7644
Author: Hubert Gruszecki <[email protected]>
AuthorDate: Wed Aug 26 21:42:02 2026 +0200

    fix(server): restore the mimalloc global allocator (#3971)
---
 core/server/src/lib.rs  | 8 ++++++++
 core/server/src/main.rs | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/core/server/src/lib.rs b/core/server/src/lib.rs
index 5ad252b5d..2f5a00932 100644
--- a/core/server/src/lib.rs
+++ b/core/server/src/lib.rs
@@ -18,6 +18,14 @@
 #![allow(clippy::future_not_send)]
 
 use iggy_common::SemanticVersion;
+#[cfg(all(feature = "mimalloc", not(feature = "disable-mimalloc")))]
+use mimalloc::MiMalloc;
+
+// Both features are checked because `--all-features` turns on `mimalloc` and
+// `disable-mimalloc` at once, while `--no-default-features` drops the crate.
+#[cfg(all(feature = "mimalloc", not(feature = "disable-mimalloc")))]
+#[global_allocator]
+static GLOBAL: MiMalloc = MiMalloc;
 
 pub const VERSION: &str = env!("CARGO_PKG_VERSION");
 pub const SEMANTIC_VERSION: SemanticVersion = 
SemanticVersion::parse_const(VERSION);
diff --git a/core/server/src/main.rs b/core/server/src/main.rs
index e2547efc7..866f46cb1 100644
--- a/core/server/src/main.rs
+++ b/core/server/src/main.rs
@@ -44,6 +44,10 @@ fn main() -> Result<(), ServerError> {
     let mut logging = Logging::new(server::VERSION);
     logging.early_init();
     server_common::print_build_info!(server::VERSION);
+    #[cfg(all(feature = "mimalloc", not(feature = "disable-mimalloc")))]
+    info!("Using mimalloc allocator");
+    #[cfg(not(all(feature = "mimalloc", not(feature = "disable-mimalloc"))))]
+    tracing::warn!("Using the default system allocator");
     if let Ok(env_path) = std::env::var("IGGY_ENV_PATH") {
         let _ = dotenvy::from_path(&env_path);
     } else {

Reply via email to