fn process<'v>(&mut self, x: Value<'v>) {
        if let Some(CallEnter {
            function,
            time,
            memory,
        }) = x.downcast_ref()
        {
            let id = self.ids.get_value(*function);
            self.ensure(id);
            self.change(*time, *memory);

            let top = self.top_id();
            let mut me = &mut self.info[id.0];
            me.calls += 1;
            *me.callers.entry(top).or_insert(0) += 1;
            self.call_stack.push((id, me.time_rec, *time));
        } else if let Some(CallExit { time, memory }) = x.downcast_ref() {
            self.change(*time, *memory);
            let (name, time_rec, start) = self.call_stack.pop().unwrap();
            self.info[name.0].time_rec =
                time_rec + time.checked_duration_since(start).unwrap_or_default();
        } else {
            let typ = x.get_ref().get_type();
            *self.top_info().allocs.entry(typ).or_insert(0) += 1;
        }
    }
/// Process each ValueMem in their chronological order
Process each ValueMem in their chronological order
Process each ValueMem in their chronological order
fn process<'v>(&mut self, x: Value<'v>) {
        if let Some(CallEnter {
            function,
            time,
            memory,
        }) = x.downcast_ref()
        {
            let id = self.ids.get_value(*function);
            self.ensure(id);
            self.change(*time, *memory);
            let top = self.top_id();
            let mut me = &mut self.info[id.0];
            me.calls += 1;
            *me.callers.entry(top).or_insert(0) += 1;
            self.call_stack.push((id, me.time_rec, *time));
        } else if let Some(CallExit { time, memory }) = x.downcast_ref() {
            self.change(*time, *memory);
            let (name, time_rec, start) = self.call_stack.pop().unwrap();
            self.info[name.0].time_rec =
                time_rec + time.checked_duration_since(start).unwrap_or_default();
        } else {
            let typ = x.get_ref().get_type();
            *self.top_info().allocs.entry(typ).or_insert(0) += 1;
        }
    }
fn process < ' v > ( & mut self , x : Value < ' v > ) { if let Some ( CallEnter { function , time , memory , } ) = x . downcast_ref ( ) { let id = self . ids . get_value ( * function ) ; self . ensure ( id ) ; self . change ( * time , * memory ) ; let top = self . top_id ( ) ; let mut me = & mut self . info [ id . 0 ] ; me . calls += 1 ; * me . callers . entry ( top ) . or_insert ( 0 ) += 1 ; self . call_stack . push ( ( id , me . time_rec , * time ) ) ; } else if let Some ( CallExit { time , memory } ) = x . downcast_ref ( ) { self . change ( * time , * memory ) ; let ( name , time_rec , start ) = self . call_stack . pop ( ) . unwrap ( ) ; self . info [ name . 0 ] . time_rec = time_rec + time . checked_duration_since ( start ) . unwrap_or_default ( ) ; } else { let typ = x . get_ref ( ) . get_type ( ) ; * self . top_info ( ) . allocs . entry ( typ ) . or_insert ( 0 ) += 1 ; } }
Process each ValueMem in their chronological order
Process each ValueMem in their chronological order
&mut self
x
Value<'v>
&mut self
x
Value<'v>