Skip to content
Snippets Groups Projects
Commit 33da5582 authored by Pietro Incardona's avatar Pietro Incardona
Browse files

Fixing examples

parent 31dccbe0
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -22,7 +22,7 @@
//! \cond [include] \endcond
#include "Plot/GoogleChart.hpp"
#include "VCluster.hpp"
#include "VCluster/VCluster.hpp"
//! \cond [include] \endcond
......
#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
*
......
#include "Grid/grid_dist_id.hpp"
#include "data_type/aggregate.hpp"
#include "Decomposition/CartDecomposition.hpp"
#include "VCluster.hpp"
#include "VCluster/VCluster.hpp"
/*!
*
......
......@@ -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
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment