darrencroton / sage

Home of the Semi-Analytic Galaxy Evolution (SAGE) galaxy formation model
MIT License
21 stars 21 forks source link

Initialize galaxy_output. #10

Closed jacobseiler closed 6 years ago

jacobseiler commented 6 years ago

Since struct(GALAXY_OUTPUT) is not aligned to 8 bytes it contains a pad. When writing out the galaxies uninitialized bytes are then written out. This commit fixes this by initializing the struct (including the pad) to 0.

Also properly free the GSL random_generator.

Valgrind produces no memory leaks, warnings or errors.

manodeep commented 6 years ago

@darrencroton This should be merged before merging the hdf5 reader PR (#9 )