diff --git a/akasa/Cargo.toml b/akasa/Cargo.toml index 59b76a8..de465f9 100644 --- a/akasa/Cargo.toml +++ b/akasa/Cargo.toml @@ -16,3 +16,6 @@ log = "0.4.17" dashmap = "5.4.0" rpassword = "7.2.0" rand = { version = "0.8.5", features = ["getrandom"] } + +[target.'cfg(not(target_env = "msvc"))'.dependencies] +tikv-jemallocator = "0.5.4" \ No newline at end of file diff --git a/akasa/src/main.rs b/akasa/src/main.rs index 281f920..4426d2b 100644 --- a/akasa/src/main.rs +++ b/akasa/src/main.rs @@ -17,6 +17,13 @@ use rand::{rngs::OsRng, RngCore}; use default_hook::DefaultHook; +#[cfg(not(target_env = "msvc"))] +use tikv_jemallocator::Jemalloc; + +#[cfg(not(target_env = "msvc"))] +#[global_allocator] +static GLOBAL: Jemalloc = Jemalloc; + #[derive(Parser, Debug)] #[clap(author, version, about, long_about = None)] /// Akasa MQTT server