Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove soft dirty page tracking
[simgrid.git] / src / mc / mc_model_checker.cpp
1 /* Copyright (c) 2008-2014. 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 "mc_model_checker.h"
8 #include "mc_page_store.h"
9
10 extern "C" {
11
12 mc_model_checker_t mc_model_checker = NULL;
13
14 mc_model_checker_t MC_model_checker_new(pid_t pid, int socket)
15 {
16   mc_model_checker_t mc = xbt_new0(s_mc_model_checker_t, 1);
17   mc->pages = mc_pages_store_new();
18   mc->fd_clear_refs = -1;
19   MC_process_init(&mc->process, pid, socket);
20   mc->hosts = xbt_dict_new();
21   return mc;
22 }
23
24 void MC_model_checker_delete(mc_model_checker_t mc)
25 {
26   mc_pages_store_delete(mc->pages);
27   if(mc->record)
28     xbt_dynar_free(&mc->record);
29   MC_process_clear(&mc->process);
30   xbt_dict_free(&mc->hosts);
31 }
32
33 unsigned long MC_smx_get_maxpid(void)
34 {
35   unsigned long maxpid;
36   MC_process_read_variable(&mc_model_checker->process, "simix_process_maxpid",
37     &maxpid, sizeof(maxpid));
38   return maxpid;
39 }
40
41 }