Only use MiMalloc on x86_64 target arch (fixes #5695) (#5885)

This commit is contained in:
Nutomic 2025-07-24 14:51:44 +00:00 committed by GitHub
parent bf2e9beae9
commit 8a93ee1473
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -248,6 +248,8 @@ serde_json = { workspace = true }
rustls = { workspace = true }
tokio.workspace = true
clap = { workspace = true }
[target.'cfg(target_arch = "x86_64")'.dependencies]
mimalloc = "0.1.46"
# Speedup RSA key generation

View file

@ -49,7 +49,6 @@ use lemmy_utils::{
settings::{structs::Settings, SETTINGS},
VERSION,
};
use mimalloc::MiMalloc;
use reqwest_middleware::ClientBuilder;
use reqwest_tracing::TracingMiddleware;
use serde_json::json;
@ -57,8 +56,9 @@ use std::{ops::Deref, time::Duration};
use tokio::signal::unix::SignalKind;
use tracing_actix_web::{DefaultRootSpanBuilder, TracingLogger};
#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;
#[cfg_attr(target_arch = "x86_64", global_allocator)]
#[cfg(target_arch = "x86_64")]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
/// Timeout for HTTP requests while sending activities. A longer timeout provides better
/// compatibility with other ActivityPub software that might allocate more time for synchronous