Skip to content

Conversation

@mabruzzo
Copy link
Collaborator

This PR converts initialize_UVbackground_data.c to initialize_UVbackground_data.cpp and initialize_cloudy_data.c to initialize_cloudy_data.cpp.

The tweaks to the source code are EXTREMELY straightforward and formulaic.

I made 3 significant changes:

  1. I make brief use of std::vector inside of initialize_UVbackground_data. This change was made to replace the use of a gcc compiler extension (and std::vector was the easiest way to replicate the prior behavior)
  2. I factored out the logic for cleaning up the allocations in my_rates->UVbackground_table. This is now handled by a function called grackle::impl::free_UVBtable (this was done for better modularity and better consistency with other datatypes)
  3. I moved the call to initialize_empty_UVBtable_struct so that it occurs at the start of initialize_UVbackground_data (for reference, we previously called initialize_empty_UVBtable_struct immediately before we called initialize_UVbackground_data -- this won't change anything about how the codebase actually works)

@mabruzzo mabruzzo added the refactor internal reorganization or code simplification with no behavior changes label Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor internal reorganization or code simplification with no behavior changes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant