-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding more smart pointers #294
Conversation
… functions with pointer arguments, and fixed a memory leak.
…to use smart pointers in DMD classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good set of changes to help modernize the code. I had a few very minor comments, but otherwise this looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for such an extensive work and all the miscellaneous code cleanup. I left some comments here and there. But they are more of questions out of curiosity, me wondering about the rationale behind your choice of smart/raw pointers.
This PR has breaking changes to the API, requiring updates to any application using libROM.
The goal is to replace raw pointers by smart pointers in the library. This has also been done in some examples, but not all, for the purpose of testing the library for memory leaks. The following examples have been run with
valgrind
successfully:mixed_nonlinear_diffusion
parametric_tw_csv
parametric_heat_conduction
de_dg_advection_greedy
poisson_local_rom_greedy
The use of smart pointers has fixed memory issues in the library and the examples. It has also simplified many things and reduced the number of lines of code significantly, making libROM not only safer but also more readable.