pub fn measure_alloctaion(&mut self, allocation: &Allocation) {
        self.current_allocations += 1;

        // weighted average of allocation sizes
        self.mean_allocation_byte_size = ((self.mean_allocation_byte_size
            * self.total_allocations as u64)
            + allocation.byte_size)
            / (self.total_allocations + 1) as u64;

        self.total_allocations += 1;

        self.max_concurrent_allocations = self
            .max_concurrent_allocations
            .max(self.current_allocations);
        self.biggest_allocation =
            self.biggest_allocation.max(allocation.byte_size);
        self.smallest_allocation =
            self.smallest_allocation.min(allocation.byte_size);
    }
/// Update counters within the metrics data structure in response to a new
/// allocation being acquired.
Update counters within the metrics data structure in response to a new
allocation being acquired.
Update counters within the metrics data structure in response to a new allocation being acquired .
pub fn measure_alloctaion(&mut self, allocation: &Allocation) {
        self.current_allocations += 1;
        // weighted average of allocation sizes
        self.mean_allocation_byte_size = ((self.mean_allocation_byte_size
            * self.total_allocations as u64)
            + allocation.byte_size)
            / (self.total_allocations + 1) as u64;
        self.total_allocations += 1;
        self.max_concurrent_allocations = self
            .max_concurrent_allocations
            .max(self.current_allocations);
        self.biggest_allocation =
            self.biggest_allocation.max(allocation.byte_size);
        self.smallest_allocation =
            self.smallest_allocation.min(allocation.byte_size);
    }
pub fn measure_alloctaion ( & mut self , allocation : & Allocation ) { self . current_allocations += 1 ; // weighted average of allocation sizes self . mean_allocation_byte_size = ( ( self . mean_allocation_byte_size * self . total_allocations as u64 ) + allocation . byte_size ) / ( self . total_allocations + 1 ) as u64 ; self . total_allocations += 1 ; self . max_concurrent_allocations = self . max_concurrent_allocations . max ( self . current_allocations ) ; self . biggest_allocation = self . biggest_allocation . max ( allocation . byte_size ) ; self . smallest_allocation = self . smallest_allocation . min ( allocation . byte_size ) ; }
Update counters within the metrics data structure in response to a new
allocation being acquired.
Update counters within the metrics data structure in response to a new allocation being acquired .
&mut self
allocation
&Allocation