From: Gabriel Corona Date: Thu, 7 Apr 2016 09:48:47 +0000 (+0200) Subject: [mc] Remove MC_state_get_internal_request() X-Git-Tag: v3_13~133 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9e8ba3861df85d86342342252be58cd546df2d08?ds=sidebyside [mc] Remove MC_state_get_internal_request() --- diff --git a/src/mc/SafetyChecker.cpp b/src/mc/SafetyChecker.cpp index 831a061f77..664379d2fd 100644 --- a/src/mc/SafetyChecker.cpp +++ b/src/mc/SafetyChecker.cpp @@ -209,7 +209,7 @@ int SafetyChecker::backtrack() std::unique_ptr state = std::move(stack_.back()); stack_.pop_back(); if (reductionMode_ == simgrid::mc::ReductionMode::dpor) { - smx_simcall_t req = MC_state_get_internal_request(state.get()); + smx_simcall_t req = &state->internal_req; if (req->call == SIMCALL_MUTEX_LOCK || req->call == SIMCALL_MUTEX_TRYLOCK) xbt_die("Mutex is currently not supported with DPOR, " "use --cfg=model-check/reduction:none"); @@ -217,7 +217,7 @@ int SafetyChecker::backtrack() for (auto i = stack_.rbegin(); i != stack_.rend(); ++i) { simgrid::mc::State* prev_state = i->get(); if (reductionMode_ != simgrid::mc::ReductionMode::none - && simgrid::mc::request_depend(req, MC_state_get_internal_request(prev_state))) { + && simgrid::mc::request_depend(req, &prev_state->internal_req)) { if (XBT_LOG_ISENABLED(mc_safety, xbt_log_priority_debug)) { XBT_DEBUG("Dependent Transitions:"); int value = prev_state->req_num; @@ -241,17 +241,17 @@ int SafetyChecker::backtrack() break; - } else if (req->issuer == MC_state_get_internal_request(prev_state)->issuer) { + } else if (req->issuer == prev_state->internal_req.issuer) { - XBT_DEBUG("Simcall %d and %d with same issuer", req->call, MC_state_get_internal_request(prev_state)->call); + XBT_DEBUG("Simcall %d and %d with same issuer", req->call, prev_state->internal_req.call); break; } else { - const smx_process_t previous_issuer = MC_smx_simcall_get_issuer(MC_state_get_internal_request(prev_state)); + const smx_process_t previous_issuer = MC_smx_simcall_get_issuer(&prev_state->internal_req); XBT_DEBUG("Simcall %d, process %lu (state %d) and simcall %d, process %lu (state %d) are independant", req->call, issuer->pid, state->num, - MC_state_get_internal_request(prev_state)->call, + prev_state->internal_req.call, previous_issuer->pid, prev_state->num); diff --git a/src/mc/mc_request.cpp b/src/mc/mc_request.cpp index f7ac9b29a8..cc844032c5 100644 --- a/src/mc/mc_request.cpp +++ b/src/mc/mc_request.cpp @@ -134,7 +134,7 @@ bool request_depend_asymmetric(smx_simcall_t r1, smx_simcall_t r2) return true; } -// Those are MC_state_get_internal_request(state) +// Those are internal_req bool request_depend(smx_simcall_t r1, smx_simcall_t r2) { if (r1->issuer == r2->issuer) diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index af22aa5ffb..1a4b90a6ef 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -68,11 +68,6 @@ RecordTraceElement State::getRecordElement() const } } -smx_simcall_t MC_state_get_internal_request(simgrid::mc::State* state) -{ - return &state->internal_req; -} - static inline smx_simcall_t MC_state_get_request_for_process( simgrid::mc::State* state, int*value, smx_process_t process) { diff --git a/src/mc/mc_state.h b/src/mc/mc_state.h index 880098cefa..957a08004b 100644 --- a/src/mc/mc_state.h +++ b/src/mc/mc_state.h @@ -166,7 +166,6 @@ XBT_PRIVATE void replay(std::list> const& st } XBT_PRIVATE simgrid::mc::State* MC_state_new(void); -XBT_PRIVATE smx_simcall_t MC_state_get_internal_request(simgrid::mc::State* state); XBT_PRIVATE smx_simcall_t MC_state_get_request(simgrid::mc::State* state, int *value); #endif