Commit 1c6d2df
committed
Fix memory leaks and add warm-up in fixture.c
This commit resolves memory leaks in the original implementation and
improves stability with a warm-up phase. Previously, the initialization
function was called multiple times within the testing function,
reallocating memory for the context array without releasing earlier
allocations, resulting in leaks detected by Valgrind (43,632 bytes
across 909 blocks per test). Now, the initialization happens only once,
and memory is released when testing completes, preventing any leaks.
Additionally, a warm-up step is added in the measurement function by
discarding the first batch of data. This filters out initial anomalies
(such as cache misses or memory allocation delays), aligning with the
design principles of the dudect framework and enhancing measurement
consistency. Previous Chinese comments are also translated to English
for better readability.
These changes ensure reliability, eliminate memory issues, and adhere
to the lightweight and stable testing approach outlined in the
dudect paper.
Change-Id: I34b257c2ae545c7c28c0c0be60e43988efc8158d1 parent f53314e commit 1c6d2df
1 file changed
+26
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
180 | 191 | | |
181 | 192 | | |
182 | 193 | | |
| |||
187 | 198 | | |
188 | 199 | | |
189 | 200 | | |
190 | | - | |
| 201 | + | |
191 | 202 | | |
192 | 203 | | |
193 | 204 | | |
194 | 205 | | |
195 | 206 | | |
196 | 207 | | |
197 | 208 | | |
198 | | - | |
199 | | - | |
200 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
201 | 220 | | |
202 | 221 | | |
203 | 222 | | |
| |||
209 | 228 | | |
210 | 229 | | |
211 | 230 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | 231 | | |
222 | 232 | | |
223 | 233 | | |
224 | 234 | | |
| 235 | + | |
| 236 | + | |
225 | 237 | | |
226 | 238 | | |
227 | | - | |
228 | 239 | | |
229 | 240 | | |
230 | 241 | | |
| |||
235 | 246 | | |
236 | 247 | | |
237 | 248 | | |
| 249 | + | |
238 | 250 | | |
239 | 251 | | |
240 | 252 | | |
| |||
0 commit comments