A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge branch 'mc-fastsnapshot' into mc
[simgrid.git]
/
src
/
mc
/
mc_checkpoint.c
diff --git
a/src/mc/mc_checkpoint.c
b/src/mc/mc_checkpoint.c
index
883f900
..
202a2f1
100644
(file)
--- a/
src/mc/mc_checkpoint.c
+++ b/
src/mc/mc_checkpoint.c
@@
-64,6
+64,9
@@
static void MC_region_destroy(mc_mem_region_t reg)
{
//munmap(reg->data, reg->size);
xbt_free(reg->data);
+ if (reg->page_numbers) {
+ mc_free_page_snapshot_region(reg->page_numbers, mc_page_count(reg->size));
+ }
xbt_free(reg);
}
@@
-166,9
+169,10
@@
static void MC_get_memory_regions(mc_snapshot_t snapshot)
snapshot->privatization_regions =
xbt_new(mc_mem_region_t, SIMIX_process_count());
for (i = 0; i < SIMIX_process_count(); i++) {
- // TODO, add support for sparse snapshot
+ mc_mem_region_t ref_reg =
+ mc_model_checker->parent_snapshot ? mc_model_checker->parent_snapshot->privatization_regions[i] : NULL;
snapshot->privatization_regions[i] =
- MC_region_new(-1, mappings[i], size_data_exe,
NULL
);
+ MC_region_new(-1, mappings[i], size_data_exe,
ref_reg
);
}
snapshot->privatization_index = loaded_page;
}
@@
-585,7
+589,7
@@
mc_snapshot_t MC_take_snapshot(int num_state)
/* Save the std heap and the writable mapped pages of libsimgrid and binary */
MC_get_memory_regions(snapshot);
- if (_sg_mc_sparse_checkpoint) {
+ if (_sg_mc_sparse_checkpoint
&& _sg_mc_soft_dirty
) {
mc_softdirty_reset();
}
@@
-630,10
+634,11
@@
void MC_restore_snapshot(mc_snapshot_t snapshot)
switch_data_segment(snapshot->privatization_index);
}
- MC_snapshot_ignore_restore(snapshot);
- if (_sg_mc_sparse_checkpoint) {
+ if (_sg_mc_sparse_checkpoint && _sg_mc_soft_dirty) {
mc_softdirty_reset();
}
+
+ MC_snapshot_ignore_restore(snapshot);
mc_model_checker->parent_snapshot = snapshot;
}