D
Developer
If I have a large chunk of memory, data_vector; and I want to make an
identical copy of it, duplicated_data--- basically a snapshot of
data_vector.
Is there a cheap way to do this? data_vector changes gradually, and I
want to make duplicated_data synchronized to data_vector at some time.
Basically, the difference between the previous 'snapshot' is just a
fraction of the whole data chunk. Is there a way to only copy the
'diff'? Let's say data_vector is around 1GB, and the 'diff' is only
10MB between snapshots.
--------------
class MyData {
private:
int data;
.....
public:
int get_data() const { return data; }
....
}
vector<MyData> data_vector;
vector<MyData> duplicated_data;
-----------------
identical copy of it, duplicated_data--- basically a snapshot of
data_vector.
Is there a cheap way to do this? data_vector changes gradually, and I
want to make duplicated_data synchronized to data_vector at some time.
Basically, the difference between the previous 'snapshot' is just a
fraction of the whole data chunk. Is there a way to only copy the
'diff'? Let's say data_vector is around 1GB, and the 'diff' is only
10MB between snapshots.
--------------
class MyData {
private:
int data;
.....
public:
int get_data() const { return data; }
....
}
vector<MyData> data_vector;
vector<MyData> duplicated_data;
-----------------