mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-04-22 16:17:23 +08:00
30 lines
871 B
Rust
30 lines
871 B
Rust
use easytier::core;
|
|
|
|
#[cfg(all(feature = "mimalloc", not(feature = "jemalloc")))]
|
|
use mimalloc::MiMalloc;
|
|
|
|
#[cfg(all(feature = "mimalloc", not(feature = "jemalloc")))]
|
|
#[global_allocator]
|
|
static GLOBAL_MIMALLOC: MiMalloc = MiMalloc;
|
|
|
|
#[cfg(feature = "jemalloc")]
|
|
#[global_allocator]
|
|
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
|
|
|
|
#[cfg(feature = "jemalloc-prof")]
|
|
#[allow(non_upper_case_globals)]
|
|
#[unsafe(export_name = "malloc_conf")]
|
|
pub static malloc_conf: &[u8] = b"prof:true,prof_active:true,lg_prof_sample:19,retain:false\0";
|
|
|
|
#[cfg(not(feature = "jemalloc-prof"))]
|
|
#[allow(non_upper_case_globals)]
|
|
#[unsafe(export_name = "malloc_conf")]
|
|
pub static malloc_conf: &[u8] = b"retain:false\0";
|
|
|
|
rust_i18n::i18n!("locales", fallback = "en");
|
|
|
|
#[tokio::main(flavor = "current_thread")]
|
|
async fn main() -> std::process::ExitCode {
|
|
core::main().await
|
|
}
|