| 202 | } |
| 203 | |
| 204 | void NodeExecStatsWrapper::Finalize() { |
| 205 | for (auto& alloc : allocations_) { |
| 206 | AllocatorMemoryUsed* memory = alloc.first; |
| 207 | for (auto& record : alloc.second->GetRecordsAndUnRef()) { |
| 208 | auto* r = memory->add_allocation_records(); |
| 209 | r->set_alloc_bytes(record.alloc_bytes); |
| 210 | r->set_alloc_micros(record.alloc_micros); |
| 211 | } |
| 212 | } |
| 213 | allocations_.clear(); |
| 214 | } |
| 215 | |
| 216 | StepStatsCollector::StepStatsCollector(StepStats* step_stats) |
| 217 | : finalized_(false), step_stats_(step_stats) {} |