Commit 8677947
committed
Fix memory leaks and add warm-up step in fixture.c
Memory leaks were addressed with the following changes:
- Valgrind inspection detected memory leaks, with 43,632 bytes lost
across 909 blocks per test.
- Investigation revealed that the initialization function was called
multiple times in the testing loop, reallocating the context array
without freeing prior allocations.
- The initialization is now executed only once, and memory is released
when testing ends, eliminating the leaks.
The measurement function was modified to include a warm-up step that
discards the first batch of data. Key observations and decisions are:
- Tests were conducted using queue insertion and removal functions to
verify constant-time behavior, showing no notable difference with or
without the warm-up step.
- The dudect paper notes potential timing variations that may impact
t-test results, such as cache misses or allocation delays.
- This step is retained to improve t-test precision in future tests,
ensuring alignment with the paper's recommended methodology.
Change-Id: I34b257c2ae545c7c28c0c0be60e43988efc8158d1 parent f53314e commit 8677947
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