From 20873fc62e6dea04f7aacec5be28ca906a137abf Mon Sep 17 00:00:00 2001 From: fanyang89 Date: Thu, 2 Jul 2026 00:07:23 +0800 Subject: [PATCH] feat(easytier): initialize hotpath profiler via hotpath::main Gate the binary entry point with hotpath::main when the feature is enabled, except when hotpath-alloc is combined with a custom global allocator (jemalloc/mimalloc), which is already rejected at compile time in lib.rs. --- easytier/src/easytier-core.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/easytier/src/easytier-core.rs b/easytier/src/easytier-core.rs index 03cf30b4..96e94681 100644 --- a/easytier/src/easytier-core.rs +++ b/easytier/src/easytier-core.rs @@ -24,6 +24,16 @@ pub static malloc_conf: &[u8] = b"retain:false\0"; rust_i18n::i18n!("locales", fallback = "en"); #[tokio::main(flavor = "current_thread")] +#[cfg_attr( + all( + feature = "hotpath", + not(all( + feature = "hotpath-alloc", + any(feature = "jemalloc", feature = "mimalloc") + )) + ), + hotpath::main +)] async fn main() -> std::process::ExitCode { core::main().await }