}
}
+unsigned long MC_process_read_dynar_length(mc_process_t process, const void* remote_dynar)
+{
+ if (!remote_dynar)
+ return 0;
+ unsigned long res;
+ MC_process_read_simple(process, &res,
+ &((xbt_dynar_t)remote_dynar)->used, sizeof(res));
+ return res;
+}
+
static pthread_once_t zero_buffer_flag = PTHREAD_ONCE_INIT;
static const void* zero_buffer;
static const int zero_buffer_size = 10 * 4096;
void* local, const void* remote, size_t len,
int process_index);
+// Simplified versions/wrappers (whould be moved in mc_address_space):
const void* MC_process_read_simple(mc_process_t process,
void* local, const void* remote, size_t len);
-
const void* MC_process_read_dynar_element(mc_process_t process,
void* local, const void* remote_dynar, size_t i);
+unsigned long MC_process_read_dynar_length(mc_process_t process, const void* remote_dynar);
/** Write data to a process memory
*
case SIMCALL_COMM_WAITANY:
*value = -1;
while (procstate->interleave_count <
- xbt_dynar_length(simcall_comm_waitany__get__comms
- (&process->simcall))) {
+ MC_process_read_dynar_length(&mc_model_checker->process,
+ simcall_comm_waitany__get__comms(&process->simcall))) {
if (MC_request_is_enabled_by_idx
(&process->simcall, procstate->interleave_count++)) {
*value = procstate->interleave_count - 1;
}
if (procstate->interleave_count >=
- xbt_dynar_length(simcall_comm_waitany__get__comms
- (&process->simcall)))
+ MC_process_read_dynar_length(&mc_model_checker->process,
+ simcall_comm_waitany__get__comms(&process->simcall)))
procstate->state = MC_DONE;
if (*value != -1)
start_count = procstate->interleave_count;
*value = -1;
while (procstate->interleave_count <
- xbt_dynar_length(simcall_comm_testany__get__comms
- (&process->simcall))) {
+ MC_process_read_dynar_length(&mc_model_checker->process,
+ simcall_comm_testany__get__comms(&process->simcall))) {
if (MC_request_is_enabled_by_idx
(&process->simcall, procstate->interleave_count++)) {
*value = procstate->interleave_count - 1;
}
if (procstate->interleave_count >=
- xbt_dynar_length(simcall_comm_testany__get__comms
- (&process->simcall)))
+ MC_process_read_dynar_length(&mc_model_checker->process,
+ simcall_comm_testany__get__comms(&process->simcall)))
procstate->state = MC_DONE;
if (*value != -1 || start_count == 0)