diff --git a/CHANGELOG.md b/CHANGELOG.md index be22f7eef102da99078f638ed1ac4435b4d6cfca..587bf61cda60ed3b4133ccc689a0a2365e710024 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ All notable changes to this project will be documented in this file. 0.7.0 or apply the patch to upgrade to 0.6.1 - Found and fixed a memory leak when using complex properties +### Changed +- The file VCluster has been mooved #include "VCluster.hpp" must be changed to #include "VCluster/VCluster.hpp" + BECAUSE OF THIS, PLEASE CLEAN THE OPENFPM FOLDER OTHERWISE YOU WILL END TO HAVE 2 VCLUSTER.HPP ## [0.6.0] - 5 November 2016 diff --git a/example/Plot/0_simple_graph/main.cpp b/example/Plot/0_simple_graph/main.cpp index a0ab4a5d84d9f5d3ec130cf432d8643e1ba77173..8f54e35fd318fc0705d4bb3667c235e27e8f656c 100644 --- a/example/Plot/0_simple_graph/main.cpp +++ b/example/Plot/0_simple_graph/main.cpp @@ -22,7 +22,7 @@ //! \cond [include] \endcond #include "Plot/GoogleChart.hpp" -#include "VCluster.hpp" +#include "VCluster/VCluster.hpp" //! \cond [include] \endcond diff --git a/example/VCluster/0_simple/main.cpp b/example/VCluster/0_simple/main.cpp index 3d0ab6fa538ba1c4f6f019113a35658b2080d3b3..af5dc17f0c0ae06a7bc4132c801df05261c667be 100644 --- a/example/VCluster/0_simple/main.cpp +++ b/example/VCluster/0_simple/main.cpp @@ -1,7 +1,7 @@ #include "Grid/grid_dist_id.hpp" #include "data_type/aggregate.hpp" #include "Decomposition/CartDecomposition.hpp" -#include "VCluster.hpp" +#include "VCluster/VCluster.hpp" /*! \page VCluster VCluster * diff --git a/example/VCluster/1_semantic/main.cpp b/example/VCluster/1_semantic/main.cpp index e721ae32a1c0c4414d6b5b4bb4ae419fd1108429..4b51c6f2a85042ea43c9a8c79780c2e9589f3f31 100644 --- a/example/VCluster/1_semantic/main.cpp +++ b/example/VCluster/1_semantic/main.cpp @@ -1,7 +1,7 @@ #include "Grid/grid_dist_id.hpp" #include "data_type/aggregate.hpp" #include "Decomposition/CartDecomposition.hpp" -#include "VCluster.hpp" +#include "VCluster/VCluster.hpp" /*! * diff --git a/example/Vector/4_complex_prop/main_ser.cpp b/example/Vector/4_complex_prop/main_ser.cpp index 3a7e91dbe282616d201d71f9c6a088c51749d71f..94868acbff09b911f891187763fecea8b2270ca2 100644 --- a/example/Vector/4_complex_prop/main_ser.cpp +++ b/example/Vector/4_complex_prop/main_ser.cpp @@ -53,12 +53,52 @@ public: ptr = NULL; } + //! Copy constructor + my_struct(const my_struct & my) + { + this->operator=(my); + } + + //! Copy constructor from temporal object + my_struct(my_struct && my) + { + this->operator=(my); + } + ~my_struct() { if (ptr != NULL) delete [] ptr; } + //! This is fundamental to avoid crash, otherwise + // we copy pointer and we do double delete + my_struct & operator=(const my_struct & my) + { + size = my.size; + str = my.str; + v = my.v; + + ptr = new char[size]; + memcpy(ptr,my.ptr,32); + + return *this; + } + + //! This is fundamental to avoid crash, otherwise + // we copy pointer and we do double delete + my_struct & operator=(my_struct && my) + { + size = my.size; + my.size = 0; + str.swap(my.str); + v.swap(my.v); + ptr = my.ptr; + my.ptr = 0; + + return *this; + } + //! \cond [con and dest] \endcond //! \cond [pack request] \endcond @@ -254,7 +294,7 @@ public: * * \snippet Vector/4_complex_prop/main_ser.cpp unpacker ser other * - * ### Constructor and destructor ### + * ### Constructor and destructor and operator= ### * * Constructor and destructor are not releated to serialization and de-serialization concept. * But on how my_struct is constructed and destructed in order to avoid memory diff --git a/src/Grid/grid_dist_id_unit_test_unb_ghost.hpp b/src/Grid/grid_dist_id_unit_test_unb_ghost.hpp index 53c3f49a588ab143fee86be3d20e8291b5495451..51fdbb517a09dbcb08e82b84f23e95e2a2677ae5 100644 --- a/src/Grid/grid_dist_id_unit_test_unb_ghost.hpp +++ b/src/Grid/grid_dist_id_unit_test_unb_ghost.hpp @@ -121,7 +121,6 @@ void Test3D_unb_ghost(const Box<3,float> & domain, long int k) // Test grid periodic - void Test3D_unb_ghost_periodic(const Box<3,float> & domain, long int k) { Vcluster & v_cl = create_vcluster();