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
Smart Pointers use #234
Comments
So what to do??? |
I think there is the need to rework the code to let all the pointers change in smart pointers |
I think smart pointers have to be introduced as it's hard to manually free all dynamic allocated memory in a growing project. And by the way, may I ask a question here @ZigRazor ? I'm confused about dynamic allocated memory in part of benchmark-related code. I dont find some place in part of benchmark-related code where we free those dynamic allocated memory to which static variables(pointers) point, and each .cpp has a copy of them because each .cpp include utility.h once respectively. So it seems a huge memory leak problem exists? `//Static Generation static auto edges = generateRandomEdges(100000, nodes); static auto undirectedEdges = generateRandomUndirectedEdges(100000, nodes); static auto cit_graph_ptr = readGraph("CitHepPh");` |
hi @suncanghuai good annotations, I think is the moment to do this, before the stable release. In benchmark related code, the dynamic allocated memory is free only when the program is terminated. But is allocated only one time because the variable is static and the include file is protected by an So the memory is allocated by the first one that use it and then never released inside the execution, but only when the executable terminates, this because these variables are used in different point of the code. |
Hi @ZigRazor, can you assign me this issue if it's still available, please? |
Yes, I assign it to you @sbaldu ! |
Closed by PR #316 |
why don't use smart pointers?
I think is better to introduce and use smart pointers in all code
The text was updated successfully, but these errors were encountered: