@@ -112,7 +112,7 @@ EmpiricalData::EmpiricalData(size_t seed, const absl::Span<const Entry> weights,
112112 total_birth_rate_ += w.alloc_rate ;
113113 const double lifespan = avg_count / w.alloc_rate ;
114114 const double death_rate = 1 / lifespan;
115- state_.push_back ({w.size , w. alloc_rate , death_rate, 0 , {}});
115+ state_.push_back ({w.size , death_rate, {}});
116116 state_.back ().objs .reserve (avg_count * 2 );
117117 }
118118
@@ -131,11 +131,6 @@ EmpiricalData::EmpiricalData(size_t seed, const absl::Span<const Entry> weights,
131131 }
132132
133133 SnapshotLiveObjects ();
134-
135- for (auto & s : state_) {
136- // Don't count initial sample towards allocations (skews data).
137- s.total = 0 ;
138- }
139134}
140135
141136EmpiricalData::~EmpiricalData () {
@@ -156,7 +151,6 @@ void* EmpiricalData::DoBirth(const size_t i) {
156151 total_bytes_allocated_ += size;
157152 void * p = alloc_ (size);
158153 s.objs .push_back (p);
159- s.total ++;
160154 return p;
161155}
162156
@@ -182,7 +176,6 @@ void EmpiricalData::RecordBirth(const size_t i) {
182176 // when building the trace we can just push nullptr to keep the length of live
183177 // object lists consistent with what it should have been after a true birth.
184178 s.objs .push_back (nullptr );
185- s.total ++;
186179}
187180
188181void * EmpiricalData::ReplayBirth (const size_t i) {
@@ -192,7 +185,6 @@ void* EmpiricalData::ReplayBirth(const size_t i) {
192185 total_bytes_allocated_ += size;
193186 void * p = alloc_ (size);
194187 s.objs .push_back (p);
195- s.total ++;
196188 return p;
197189}
198190
@@ -250,8 +242,7 @@ void EmpiricalData::ReplayNext() {
250242
251243void EmpiricalData::SnapshotLiveObjects () {
252244 for (const auto & s : state_) {
253- snapshot_state_.push_back (
254- {s.size , s.birth_rate , s.death_rate , s.total , s.objs });
245+ snapshot_state_.push_back ({s.size , s.death_rate , s.objs });
255246 }
256247}
257248
0 commit comments