#[allow(missing_debug_implementations)]
#[repr(packed)]
pub struct RetaHashStatistics<A: Array<AtomicU64>>
{
counters: A,
}
impl<A: Array<AtomicU64>> Default for RetaHashStatistics<A>
{
#[inline(always)]
fn default() -> Self
{
unsafe { zeroed() }
}
}
impl<A: 'static + Array<AtomicU64>> RetaHashStatistics<A>
{
#[inline(always)]
pub fn incrementFrom_rte_mbuf_rss(&mut self, rss: u32)
{
let index = rss as usize & A::mask();
let counter = unsafe { self.counters.get_unchecked_mut(index) };
counter.fetch_add(1, Ordering::Relaxed);
}
}