Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Move mc_liveness code in simgrid::mc
[simgrid.git] / src / mc / mc_pair.cpp
1 /* Copyright (c) 2013-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <xbt/dynar.h>
8 #include <xbt/sysdep.h>
9
10 #include "src/mc/mc_liveness.h"
11 #include "src/mc/mc_private.h"
12
13 namespace simgrid {
14 namespace mc {
15
16 simgrid::mc::Pair* pair_new()
17 {
18   simgrid::mc::Pair* p = nullptr;
19   p = xbt_new0(simgrid::mc::Pair, 1);
20   p->num = ++mc_stats->expanded_pairs;
21   p->exploration_started = 0;
22   p->search_cycle = 0;
23   p->visited_pair_removed = _sg_mc_visited > 0 ? 0 : 1;
24   return p;
25 }
26
27 void pair_delete(simgrid::mc::Pair* p)
28 {
29   p->automaton_state = nullptr;
30   if(p->visited_pair_removed)
31     MC_state_delete(p->graph_state, 1);
32   xbt_dynar_free(&(p->atomic_propositions));
33   xbt_free(p);
34   p = nullptr;
35 }
36
37 }
38 }