Skip to content
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

C++ style memory allocation. #74

Open
TeachRaccooon opened this issue Sep 7, 2024 · 0 comments
Open

C++ style memory allocation. #74

TeachRaccooon opened this issue Sep 7, 2024 · 0 comments

Comments

@TeachRaccooon
Copy link
Contributor

TeachRaccooon commented Sep 7, 2024

At the moment, I use calloc all throughout the repo.
Makes sense to change that.
Riley's comment:

If you do new T[length_of_buffer]{} (not the curly braces), then it will zero-initialize.
An advantage to new is that it will work if T is std::complex or std::complex (defacto-standard datatypes for complex floats in C++). I don't know if calloc will work in that situation.
That said, calloc apparently works with realloc, while new does not.
I says we open a GitHub issue about this so we establish a policy for new contributions.

We also need to consider getting rid of the internal allocations.
The discussion on all that is present in PR#71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant