Commit 450eb08
fix: plug memory leaks in haploid_highd destructor
The free_mem() function was not releasing several allocated arrays,
causing significant memory leaks during evolution simulations with
CROSSOVERS recombination model.
Fixed by adding deletion of:
- genome array (auxiliary array for crossover points)
- crossovers array (crossover points storage)
- trait_stat array (trait statistics)
- trait_covariance matrix (2D array)
- trait_weights array
- gsl_rng generator (via gsl_rng_free)
This reduces memory growth during evolution, though further
investigation is needed for remaining accumulation during evolve().
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent fff0d9c commit 450eb08
1 file changed
+9
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
193 | 202 | | |
194 | 203 | | |
195 | 204 | | |
| |||
0 commit comments