From e5ca3351153fa6f3d1e3b00806f85058a8182065 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 2 Nov 2024 10:05:28 +0300 Subject: Add Tracy allocation profiling feature flag --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index d0de54a8..1d4ed56f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,6 +33,11 @@ use tracing_subscriber::EnvFilter; const DEFAULT_LOG_FILTER: &str = "niri=debug,smithay::backend::renderer::gles=error"; +#[cfg(feature = "profile-with-tracy-allocations")] +#[global_allocator] +static GLOBAL: tracy_client::ProfiledAllocator = + tracy_client::ProfiledAllocator::new(std::alloc::System, 100); + fn main() -> Result<(), Box> { // Set backtrace defaults if not set. if env::var_os("RUST_BACKTRACE").is_none() { -- cgit