mimalloc usage

This commit is contained in:
ssrlive 2024-08-02 10:18:11 +08:00
parent 6567b6bc00
commit 1dd6746bbc
2 changed files with 5 additions and 0 deletions

View file

@ -27,6 +27,7 @@ hickory-proto = "0.24"
httparse = "1"
ipstack = { version = "0.1" }
log = { version = "0.4", features = ["std"] }
mimalloc = { version = "0.1", default-features = false, optional = true }
percent-encoding = "2"
socks5-impl = { version = "0.5" }
thiserror = "1"

View file

@ -30,6 +30,10 @@ pub use {
traffic_status::{tun2proxy_set_traffic_status_callback, TrafficStatus},
};
#[cfg(feature = "mimalloc")]
#[global_allocator]
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
#[cfg(any(target_os = "windows", target_os = "macos", target_os = "linux"))]
pub use desktop_api::desktop_run_async;