← Back to team overview

dolfin team mailing list archive

Ownership

 

In trying to follow some pieces code recently and tracking down some memory leaks, I see that as some classes have become more sophisticated, ownership is not always clear. Where we used to use references to data, we often now need to use pointers. This lead to a number of leaks and makes code harder to read.

I don't know of any simple solutions for this, but it is worth discussing what to do. It might just be a case of naming conventions. Perhaps an idea is to start by trying returning smart pointers in the linear algebra factories? Boost provides a number of smart pointers that are straightforward to use. If this works, we can try using them more extensively.

Garth


Follow ups