- xbt_dynar_t comms;
- simgrid::kernel::activity::CommImpl* act =
- static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(req));
-
-#if SIMGRID_HAVE_MC
- s_xbt_dynar_t comms_buffer;
- size_t buffer_size = 0;
- if (mc_model_checker != nullptr) {
- // Read dynar:
- mc_model_checker->process().read(&comms_buffer, remote(simcall_comm_waitany__get__comms(req)));
- assert(comms_buffer.elmsize == sizeof(act));
- buffer_size = comms_buffer.elmsize * comms_buffer.used;
- comms = &comms_buffer;
- } else
- comms = simcall_comm_waitany__get__comms(req);
-
- // Read all the dynar buffer:
- char buffer[buffer_size];
- if (mc_model_checker != nullptr)
- mc_model_checker->process().read_bytes(buffer, sizeof(buffer), remote(comms->data));
-#else
- comms = simcall_comm_waitany__get__comms(req);
-#endif
-
- for (unsigned int index = 0; index < comms->used; ++index) {
-#if SIMGRID_HAVE_MC
- // Fetch act from MCed memory:
- // HACK, type puning
- simgrid::mc::Remote<simgrid::kernel::activity::CommImpl> temp_comm;
- if (mc_model_checker != nullptr) {
- memcpy(&act, buffer + comms->elmsize * index, sizeof(act));
- mc_model_checker->process().read(temp_comm, remote(act));
- act = static_cast<simgrid::kernel::activity::CommImpl*>(temp_comm.getBuffer());
- } else
-#endif
- act = xbt_dynar_get_as(comms, index, simgrid::kernel::activity::CommImpl*);
- if (act->src_proc && act->dst_proc)
+ simgrid::kernel::activity::CommImpl** comms = simcall_comm_waitany__get__comms(req);
+ size_t count = simcall_comm_waitany__get__count(req);
+ for (unsigned int index = 0; index < count; ++index) {
+ auto* comm = comms[index];
+ if (comm->src_actor_ && comm->dst_actor_)