- while (str_len--) {
- c = *str++;
- hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
- }
-
- return hash;
-
-}
-
-int create_dump(int pair)
-{
- // Try to enable core dumps
- struct rlimit core_limit;
- core_limit.rlim_cur = RLIM_INFINITY;
- core_limit.rlim_max = RLIM_INFINITY;
-
- if(setrlimit(RLIMIT_CORE, &core_limit) < 0)
- fprintf(stderr, "setrlimit: %s\nWarning: core dumps may be truncated or non-existant\n", strerror(errno));
-
- int status;
- switch(fork()){
- case 0:
- // We are the child process -- run the actual program
- abort();
- break;
-
- case -1:
- // An error occurred, shouldn't happen
- perror("fork");
- return -1;
-
- default:
- // We are the parent process -- wait for the child process to exit
- if(wait(&status) < 0)
- perror("wait");
- if(WIFSIGNALED(status) && WCOREDUMP(status)){
- char *core_name = malloc(20);
- sprintf(core_name,"core_%d", pair);
- rename("core", core_name);
- free(core_name);
- }
- }
-
- return 0;
-}
-
-int reached(xbt_state_t st){
-
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
-
- MC_SET_RAW_MEM;
-
- mc_pair_reached_t new_pair = NULL;
- new_pair = xbt_new0(s_mc_pair_reached_t, 1);
- new_pair->nb = xbt_dynar_length(reached_pairs) + 1;
- new_pair->automaton_state = st;
- new_pair->prop_ato = xbt_dynar_new(sizeof(int), NULL);
- new_pair->system_state = xbt_new0(s_mc_snapshot_t, 1);
- MC_take_snapshot_liveness(new_pair->system_state);
-
- /* Get values of propositional symbols */