Re: [eigen] Memory Leak When Constructor of User-Defined Type Throws Exception

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On 21.07.2014 16:30, Christoph Hertzberg wrote:
I found that ctest is actually able to run tests through valgrind. I
failed to set this up so far, but it would certainly be nice in general.

Is there anybody with cmake/ctest experience who knows how to set up (automatically) running the tests with valgrind?

[...] Then, we can write the above code as

     EIGEN_TRY
       {
         do_stuff();
         if (bad_things_happened())
           EIGEN_THROW(Ball("oh no!"));
       }
     EIGEN_CATCH(const Ball&)
       {
         do_other_stuff();
       }

I found some further occurrences of that construct and decided to use your suggestion, I also improved your unit test slightly and added the possibility to run the unit-tests with exceptions disabled:

https://bitbucket.org/eigen/eigen/commits/c071cfb

I locally ran the unit-tests before pushing, but only on g++4.8 and clang3.4 (both with and without exceptions). It would be nice if someone could check MSVC as well.

Christoph


--
----------------------------------------------
Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252
----------------------------------------------



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/