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