-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit 00cd93a
Improve dudect test with memory leak fix
Valgrind inspection revealed memory leaks in the original code, with
43,632 bytes lost across 909 blocks per test. Analysis showed that the
initialization function was being called repeatedly within the testing
loop, each time reallocating the context array without any provision to
free prior memory allocations. This uncontrolled repetition caused
memory to accumulate not freed over multiple test iterations, leading to
the observed leaks. To correct this, the initialization process was
revised to execute only once before testing begins, and a cleanup was
added to release all allocated memory when testing concludes. To further
prevent memory-related issues, the measurement function was updated to
check all memory allocations, ensuring robustness against potential
failures.
Change-Id: Id5e7b24447cb5b7797ef19c4bfdb79060fb299fa1 parent f53314e commit 00cd93a
1 file changed
+11
-4
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
187 | 187 |
| |
188 | 188 |
| |
189 | 189 |
| |
190 | - | ||
190 | + | ||
191 | 191 |
| |
192 | 192 |
| |
193 | 193 |
| |
| |||
213 | 213 |
| |
214 | 214 |
| |
215 | 215 |
| |
216 | - | ||
217 | - | ||
216 | + | ||
217 | + | ||
218 | + | ||
219 | + | ||
220 | + | ||
221 | + | ||
222 | + | ||
218 | 223 |
| |
219 | 224 |
| |
220 | 225 |
| |
221 | 226 |
| |
222 | 227 |
| |
223 | 228 |
| |
224 | 229 |
| |
230 | + | ||
231 | + | ||
225 | 232 |
| |
226 | 233 |
| |
227 | - | ||
228 | 234 |
| |
229 | 235 |
| |
230 | 236 |
| |
| |||
235 | 241 |
| |
236 | 242 |
| |
237 | 243 |
| |
244 | + | ||
238 | 245 |
| |
239 | 246 |
| |
240 | 247 |
| |
|
0 commit comments