Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Indent include and src using this command:
[simgrid.git] / src / mc / mc_checkpoint.c
1 #include "private.h"
2
3 void MC_take_snapshot(mc_snapshot_t snapshot)
4 {
5 /* Save the heap! */
6   snapshot->heap_size = MC_save_heap(&(snapshot->heap));
7
8 /* Save data and bss that */
9   snapshot->data_size = MC_save_dataseg(&(snapshot->data));
10 }
11
12 void MC_restore_snapshot(mc_snapshot_t snapshot)
13 {
14   MC_restore_heap(snapshot->heap, snapshot->heap_size);
15   MC_restore_dataseg(snapshot->data, snapshot->data_size);
16 }
17
18 void MC_free_snapshot(mc_snapshot_t snapshot)
19 {
20   xbt_free(snapshot->heap);
21   xbt_free(snapshot->data);
22   xbt_free(snapshot);
23 }