memtt / malt

MALT is a MALloc Tracker to find where and how your made your memory allocations in C/C++/Fortran applications.
https://memtt.github.io/malt/
Other
108 stars 16 forks source link

Improve exception safety with smart pointers #9

Open elfring opened 5 years ago

elfring commented 5 years ago

Would you like to wrap any pointer data members with the class template “std::unique_ptr”?

Update candidates:

svalat commented 5 years ago

Yes will do, thanks for looking my code, that's really nice. If you find some other stuff, don't limit yourself.

svalat commented 5 years ago

Ok, that require a little bit more work as I didn't yet enabled CXX11 on this project to keep portability on old HPC systems. But will look, now it should be fine mostly on all distributions.

It needs to rewrite the - STLInternalAllocator.

Also I looked on the lines. You speak about the dyanmic arrays ? That's more moving them to std::vector & std::array than using std::unique_ptr no ? Otherwise it will messup if I put composed types inside the ProfiledValue class.

elfring commented 5 years ago

I suggest to take another look at the implementation detail when some new and delete operators are used in affected C++ classes.