1 //! Macros to simple performance profiling using perftools. 2 3 /// Only inline when not profiling. 4 macro_rules! perftools_inline { 5 ($($item:tt)*) => ( 6 #[cfg_attr(feature = "noinline", inline(never))] 7 #[cfg_attr(not(feature = "noinline"), inline)] 8 $($item)* 9 ); 10 } 11 12 /// Only inline when not profiling. 13 macro_rules! perftools_inline_always { 14 ($($item:tt)*) => ( 15 #[cfg_attr(feature = "noinline", inline(never))] 16 #[cfg_attr(not(feature = "noinline"), inline(always))] 17 $($item)* 18 ) 19 } 20